Open Metaverse JIRA issue tracker

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile
  • libopenmetaverse
  • LIBOMV-243

OpenJPEG Quality Issues Redux

  • Voters
  • Watchers
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 0.4.0, 0.4.1, 0.4.1.1, 0.6.1.1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Severity:
    High
  • Environment:
    .NET / Windows32
  • Steps to Reproduce:
    Hide

    Upload a smaller ( < 1024x1024) detailed image with SLImageUpload. To more easily see artifacts use contrasting, monochromatic hues.

    Show
    Upload a smaller ( < 1024x1024) detailed image with SLImageUpload. To more easily see artifacts use contrasting, monochromatic hues.

Description

Nasty artifacts and poor image quality present on images encoded and uploaded via openJPEG-libsl.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    SL_result.tga
    19/May/08 3:17 PM
    768 kB
    gonta maltz
  2. File
    plywood.tga
    19/Aug/08 1:28 PM
    768 kB
    Shack Dougall
  3. File
    openjpeg_result.tga
    19/May/08 3:17 PM
    768 kB
    gonta maltz
  4. Text File
    LIBOMV-243-with_image_component_sensitivity.patch
    23/May/08 10:39 AM
    0.8 kB
    gonta maltz
  5. Text File
    LIBOMV-243.patch
    23/May/08 10:22 AM
    0.7 kB
    gonta maltz
  1. plywood_uploaded_not_lossless.jpg
    104 kB
    19/Aug/08 1:30 PM
  2. original_image.png
    139 kB
    19/May/08 3:05 PM

Issue Links

blocks

Task - A task that needs to be done. LIBOMV-251 Need to compile new OS X, 32bit and 64bit openjpeg libraries See LIBOMV-243

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.
is blocked by

Task - A task that needs to be done. LIBOMV-251 Need to compile new OS X, 32bit and 64bit openjpeg libraries See LIBOMV-243

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • Commits
Hide
Permalink
gonta maltz added a comment - 19/May/08 3:08 PM

Removed large TGA example images and replaced with equally compressed JPEG.

Show
gonta maltz added a comment - 19/May/08 3:08 PM Removed large TGA example images and replaced with equally compressed JPEG.
Hide
Permalink
James Neal added a comment - 19/May/08 3:13 PM

We would prefer uncompressed images to do comparisons. Don't worry about the size

Show
James Neal added a comment - 19/May/08 3:13 PM We would prefer uncompressed images to do comparisons. Don't worry about the size
Hide
Permalink
gonta maltz added a comment - 19/May/08 3:17 PM

^ reverted

Show
gonta maltz added a comment - 19/May/08 3:17 PM ^ reverted
Hide
Permalink
James Neal added a comment - 19/May/08 3:17 PM

thanks

Show
James Neal added a comment - 19/May/08 3:17 PM thanks
Hide
Permalink
Jim Radford added a comment - 19/May/08 3:18 PM

Gonta, Are you trying to upload these with lossless compression?

Show
Jim Radford added a comment - 19/May/08 3:18 PM Gonta, Are you trying to upload these with lossless compression?
Hide
Permalink
James Neal added a comment - 19/May/08 3:20 PM

Can you give more specifics on this test.. How was the image uploaded to SL? Was it marked as lossless or are both examples compressed j2c ?

Show
James Neal added a comment - 19/May/08 3:20 PM Can you give more specifics on this test.. How was the image uploaded to SL? Was it marked as lossless or are both examples compressed j2c ?
Hide
Permalink
gonta maltz added a comment - 19/May/08 3:24 PM - edited

These were not uploaded with lossless. The TGA is the compressed jpeg2000 created with SL's "Save Texture As..." (Hence massive filesize)

Show
gonta maltz added a comment - 19/May/08 3:24 PM - edited These were not uploaded with lossless. The TGA is the compressed jpeg2000 created with SL's "Save Texture As..." (Hence massive filesize)
Hide
Permalink
gonta maltz added a comment - 23/May/08 10:22 AM

Patch attached. Values identical to http://jira.secondlife.com/browse/VWR-1475 viewer patch http://jira.secondlife.com/secure/attachment/13226/VWR-1475-ll.patch

Show
gonta maltz added a comment - 23/May/08 10:22 AM Patch attached. Values identical to http://jira.secondlife.com/browse/VWR-1475 viewer patch http://jira.secondlife.com/secure/attachment/13226/VWR-1475-ll.patch
Hide
Permalink
gonta maltz added a comment - 23/May/08 10:39 AM

Included

if (image->components >= 3)
{
cparameters.tcp_mct = 1;
}

No more wierd colors while images are loading!

Show
gonta maltz added a comment - 23/May/08 10:39 AM Included if (image->components >= 3) { cparameters.tcp_mct = 1; } No more wierd colors while images are loading!
Hide
Permalink
Uchi Desmoulins added a comment - 23/May/08 10:42 AM

Everything's awesomesauce, now!

Show
Uchi Desmoulins added a comment - 23/May/08 10:42 AM Everything's awesomesauce, now!
Hide
Permalink
James Neal added a comment - 23/May/08 1:10 PM

Yeah, we should be using the same values. Good work

Show
James Neal added a comment - 23/May/08 1:10 PM Yeah, we should be using the same values. Good work
Hide
Permalink
Jim Radford added a comment - 25/May/08 12:46 PM

Updated in trunk and included updated openjpeg-libsl.dll binary for 32 bit windows systems.

Show
Jim Radford added a comment - 25/May/08 12:46 PM Updated in trunk and included updated openjpeg-libsl.dll binary for 32 bit windows systems.
Hide
Permalink
James Neal added a comment - 26/May/08 6:12 AM - edited

Are our images of a similar quality to the viewer?

Show
James Neal added a comment - 26/May/08 6:12 AM - edited Are our images of a similar quality to the viewer?
Hide
Permalink
gonta maltz added a comment - 26/May/08 7:06 AM

Yeah, they are now. Nasty artifacts are gone, as well as the discoloration seen while loading images created prior to the fix.

Show
gonta maltz added a comment - 26/May/08 7:06 AM Yeah, they are now. Nasty artifacts are gone, as well as the discoloration seen while loading images created prior to the fix.
Hide
Permalink
Jim Radford added a comment - 15/Jul/08 1:16 PM

This fix caused a side effect in that the alpha layers on the head are not baking properly on Avatars (ie: Eyelashes are solid, with no alpha)

Show
Jim Radford added a comment - 15/Jul/08 1:16 PM This fix caused a side effect in that the alpha layers on the head are not baking properly on Avatars (ie: Eyelashes are solid, with no alpha)
Hide
Permalink
Jim Radford added a comment - 15/Jul/08 1:21 PM

Need to get this issue straightened out before continuing LIBOMV-251, Adding Link

Show
Jim Radford added a comment - 15/Jul/08 1:21 PM Need to get this issue straightened out before continuing LIBOMV-251, Adding Link
Hide
Permalink
Shack Dougall added a comment - 19/Aug/08 1:27 PM

I'm seeing some serious weirdness with uploading TGA images. A TGA with no alpha channel appears to have an alpha channel after being uploaded. The problem is more severe if lossless is turned off. When lossless is turned on, the problem happens, but the amount of transparency is small. When lossless is turned off, I see a huge amount of transparency. Both cases are bad.

It's also strange that if I save the bad TGA to disk using the official SL client, the saved image doesn't have any transparency.

I'll attach a couple of samples: plywood.tga and plywood_uploaded_not_lossless.jpg

Windows XP. Happens in 0.5.0 and r2123 (trunk). Happens in SLImageUpload/GridImageUpload as well as my code (Prim Composer for 3ds Max). I think the problem has been around for at least a couple of months, but I hadn't noticed it before because I was uploading sculptmaps which don't care about transparency and since I was uploading them lossless, the problem wasn't obvious at a glance.

Anyway, I'm very interested to know if anyone else sees this.

Show
Shack Dougall added a comment - 19/Aug/08 1:27 PM I'm seeing some serious weirdness with uploading TGA images. A TGA with no alpha channel appears to have an alpha channel after being uploaded. The problem is more severe if lossless is turned off. When lossless is turned on, the problem happens, but the amount of transparency is small. When lossless is turned off, I see a huge amount of transparency. Both cases are bad. It's also strange that if I save the bad TGA to disk using the official SL client, the saved image doesn't have any transparency. I'll attach a couple of samples: plywood.tga and plywood_uploaded_not_lossless.jpg Windows XP. Happens in 0.5.0 and r2123 (trunk). Happens in SLImageUpload/GridImageUpload as well as my code (Prim Composer for 3ds Max). I think the problem has been around for at least a couple of months, but I hadn't noticed it before because I was uploading sculptmaps which don't care about transparency and since I was uploading them lossless, the problem wasn't obvious at a glance. Anyway, I'm very interested to know if anyone else sees this.
Hide
Permalink
Shack Dougall added a comment - 19/Aug/08 1:28 PM

TGA no alpha channel

Show
Shack Dougall added a comment - 19/Aug/08 1:28 PM TGA no alpha channel
Hide
Permalink
Shack Dougall added a comment - 19/Aug/08 1:30 PM

TGA with no alpha channel after being uploaded without lossless. Transparency!

Show
Shack Dougall added a comment - 19/Aug/08 1:30 PM TGA with no alpha channel after being uploaded without lossless. Transparency!
Hide
Permalink
Shack Dougall added a comment - 27/Aug/08 11:36 PM

Seems like there's been some activity on this issue lately.

I just finished some testing on trunk (r2178). I tried TGA and PNG, lossless and not, transparency in the image and not, using GridImageUpload.exe. The results were good. All of the images were faithful reproductions with and without alpha.

The only problem is that a 24-bit TGA is still getting an alpha channel added, even though it doesn't have one to begin with. This doesn't affect the way that the image looks at all, but it causes the SL viewer to treat it like a transparent image. For example, if you put the texture on two intersecting prims and move the camera around, you will see the textures fighting for which one should be on top. PNG doesn't seem to have this problem. A non-alpha PNG stays non-alpha when it is uploaded.

So, overall, I'd say that this is a big improvement. If we can eliminate the superfluous alpha layer on 24-bit TGAs, then I think it's perfect. For testing, you can use the plywood.tga that I uploaded previously.

Note: I'm having some unrelated issues with trunk which I reported on the mailing list. Having some problems with prim rezzing. I only mention it to let people know that trunk might not be completely stable ATM.

Show
Shack Dougall added a comment - 27/Aug/08 11:36 PM Seems like there's been some activity on this issue lately. I just finished some testing on trunk (r2178). I tried TGA and PNG, lossless and not, transparency in the image and not, using GridImageUpload.exe. The results were good. All of the images were faithful reproductions with and without alpha. The only problem is that a 24-bit TGA is still getting an alpha channel added, even though it doesn't have one to begin with. This doesn't affect the way that the image looks at all, but it causes the SL viewer to treat it like a transparent image. For example, if you put the texture on two intersecting prims and move the camera around, you will see the textures fighting for which one should be on top. PNG doesn't seem to have this problem. A non-alpha PNG stays non-alpha when it is uploaded. So, overall, I'd say that this is a big improvement. If we can eliminate the superfluous alpha layer on 24-bit TGAs, then I think it's perfect. For testing, you can use the plywood.tga that I uploaded previously. Note: I'm having some unrelated issues with trunk which I reported on the mailing list. Having some problems with prim rezzing. I only mention it to let people know that trunk might not be completely stable ATM.
Hide
Permalink
Shack Dougall added a comment - 18/Nov/08 4:36 AM

Do we have any chance of getting this resolved? The fact that uploaded 24 bit TGAs get converted to 32 bit images with an alpha channel is a major irritant.

It means, for example, that a linkset that is uploaded with TGA textures will look completely wacky in SL because all of the textures in the build will be fighting with each other for who should be on top. It's intolerable.

I've started digging in the code and I think I see where it happens, but I'm still a long way from understanding how to fix it.

If you look in LoadTGAClass.LoadTGA(), you'll see that it always creates a Bitmap with System.Drawing.Imaging.PixelFormat.Format32bppPArgb, regardless to whether there is an alpha channel in the source image or not. For comparison, the same image in a PNG file and loaded with System.Drawing.Image.FromFile() is given a PixelFormat of Format24bppRgb.

Show
Shack Dougall added a comment - 18/Nov/08 4:36 AM Do we have any chance of getting this resolved? The fact that uploaded 24 bit TGAs get converted to 32 bit images with an alpha channel is a major irritant. It means, for example, that a linkset that is uploaded with TGA textures will look completely wacky in SL because all of the textures in the build will be fighting with each other for who should be on top. It's intolerable. I've started digging in the code and I think I see where it happens, but I'm still a long way from understanding how to fix it. If you look in LoadTGAClass.LoadTGA(), you'll see that it always creates a Bitmap with System.Drawing.Imaging.PixelFormat.Format32bppPArgb, regardless to whether there is an alpha channel in the source image or not. For comparison, the same image in a PNG file and loaded with System.Drawing.Image.FromFile() is given a PixelFormat of Format24bppRgb.
Hide
Permalink
Shack Dougall added a comment - 19/Nov/08 12:58 AM

I've found a workaround.

FreeImage (http://freeimage.sourceforge.net/) has a liberal license and an excellent c# wrapper.

Instead of calling:

image = LoadTGAClass.LoadTGA(imagePath);

I can use FreeImage by calling:

FREE_IMAGE_FORMAT imgFormat = FREE_IMAGE_FORMAT.FIF_UNKNOWN;
image = FreeImage.LoadBitmap(imagePath,FREE_IMAGE_LOAD_FLAGS.DEFAULT, ref imgFormat);

And it creates a Bitmap with PixelFormat.Format24bppRgb like I want.

I haven't thoroughly tested it yet, but it was easy to integrate and is well documented. Looks like a winner.

Show
Shack Dougall added a comment - 19/Nov/08 12:58 AM I've found a workaround. FreeImage (http://freeimage.sourceforge.net/) has a liberal license and an excellent c# wrapper. Instead of calling: image = LoadTGAClass.LoadTGA(imagePath); I can use FreeImage by calling: FREE_IMAGE_FORMAT imgFormat = FREE_IMAGE_FORMAT.FIF_UNKNOWN; image = FreeImage.LoadBitmap(imagePath,FREE_IMAGE_LOAD_FLAGS.DEFAULT, ref imgFormat); And it creates a Bitmap with PixelFormat.Format24bppRgb like I want. I haven't thoroughly tested it yet, but it was easy to integrate and is well documented. Looks like a winner.
Hide
Permalink
Jonathan Ballard added a comment - 02/May/09 3:27 AM - edited

I've tried to isolate the alpha bug in the openjpeg library. It appears this has gone unnoticed since the viewer uploaded images as lossless. Now that they are irreversible enabled, the alpha bug emerges.

Related discussion:
http://groups.google.com/group/openjpeg/tree/browse_frm/thread/4683bba9660c2779#doc_a5d7e1d610446e2f
http://groups.google.com/group/openjpeg/browse_thread/thread/1cb7807b2053592e

Contact me if you or anybody has found a fix to encode images with alpha (32bit, not 24bit).

Show
Jonathan Ballard added a comment - 02/May/09 3:27 AM - edited I've tried to isolate the alpha bug in the openjpeg library. It appears this has gone unnoticed since the viewer uploaded images as lossless. Now that they are irreversible enabled, the alpha bug emerges. Related discussion: http://groups.google.com/group/openjpeg/tree/browse_frm/thread/4683bba9660c2779#doc_a5d7e1d610446e2f http://groups.google.com/group/openjpeg/browse_thread/thread/1cb7807b2053592e Contact me if you or anybody has found a fix to encode images with alpha (32bit, not 24bit).
Hide
Permalink
John Hurliman added a comment - 27/May/09 5:34 AM

My understanding is that this is an OpenJPEG issue and we are waiting on an upstream fix. Setting assignee to null for now. If this is incorrect please update.

Show
John Hurliman added a comment - 27/May/09 5:34 AM My understanding is that this is an OpenJPEG issue and we are waiting on an upstream fix. Setting assignee to null for now. If this is incorrect please update.
Hide
Permalink
glem02 added a comment - 06/Dec/09 7:35 AM - edited

Any news on this bug? Do we have to use the recommended workaround with freeimage (s. above)?

Complex textured objects look weird after import because of those conversion and alpha issues in OpenJPEG (running TestClient on Windows7 - 64bit). The problem could become even bigger, as the transfers between grids and the usage of 64bit OS (e.g. Win-7 and Linux) is increasing quite fast.

This problem should deserve a higher priority!

Thanks, glem

Show
glem02 added a comment - 06/Dec/09 7:35 AM - edited Any news on this bug? Do we have to use the recommended workaround with freeimage (s. above)? Complex textured objects look weird after import because of those conversion and alpha issues in OpenJPEG (running TestClient on Windows7 - 64bit). The problem could become even bigger, as the transfers between grids and the usage of 64bit OS (e.g. Win-7 and Linux) is increasing quite fast. This problem should deserve a higher priority! Thanks, glem
Hide
Permalink
glem02 added a comment - 07/Dec/09 4:09 PM

I was thinking on a workaround...

Is there any way to use the kakadu library from the viewers (llkdu.dll) for uploading images? Is there some example how tu use it?
Or would I need to buy the code for this library and recompile it?

Glem

Show
glem02 added a comment - 07/Dec/09 4:09 PM I was thinking on a workaround... Is there any way to use the kakadu library from the viewers (llkdu.dll) for uploading images? Is there some example how tu use it? Or would I need to buy the code for this library and recompile it? Glem

People

  • Assignee:
    Unassigned
    Reporter:
    gonta maltz
Vote (3)
Watch (4)

Dates

  • Created:
    19/May/08 3:05 PM
    Updated:
    06/Feb/11 7:45 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Radegast Metaverse Client. Try JIRA - bug tracking software for your team.