Bug #237 - png export does not preserve transparency
Product:PageStream 5.0.4.17 (All Platforms)Reported By:Tim Doty
Severity:NormalAssigned To:Deron Kazmaier
Priority:Average sign in to watch (1 is watching)
Status:Fixed in 5.0.4.21Reported:2008-07-04 15:25:38
Category:Text EditingUpdated:2008-07-04 15:25:38
Summary:png export does not preserve transparency
Keywords:png export transparency
Attached Files:No files attached.
 Sign In to add a file.

Take an object with transparency, e.g., a PgS drawing, and export as a png. On import the parts of the graphic that should be transparent are white. Verified in Photoshop that the pixels are in fact white and not an artifact of the png import module. As png supports full 8-bit transparency this is less than desirable. As certain fills are not preserved when, e.g., creating PDF, rasterizing the drawing is the only way at present to make such illustrations be correct -- except if they rely on transparency there is no way at present to do this...

Deron Kazmaier wrote...2008-07-04 18:48:00

Does the PNG export preserve transparency if exporting an image with transparency? This issue raised in this bug has nothing to do with the PNG export filter, but instead to do with the rasterizer starts with a white image, not a transparent image.

[Status updated to 'Assigned' on Fri, 04 Jul 2008 18:48:00 -0400]

Tim Doty wrote...2008-07-04 18:54:15

The "image" has a lot of "transparency" -- space is only partially occupied by filled vectors. It is the rest, the empty space, which gets filled with white but should properly be 100% transparent (0% opaque depending on the model used) as there is nothing there.

Deron Kazmaier wrote...2008-07-04 19:10:54

I understand the problem, but I question that it is the PNG filters fault. PageStream renders the objects into an image, not the PNG filter. PageStream renders the image, and then passes it to the filter. I am simply questioning if the PNG filter can export an image imported with alpha. I know it is not getting the proper data for a selection of objects in your case.

You can verify that it has nothing to do with PNG by using the ILBM filter to save your items, because the ILBM filter absolutely supports alpha mask. If it didn't you couldn't load/save a document with transparent images.

Tim Doty wrote...2008-07-04 21:38:42

Okay, wherever the problem lies should be fixed?

Deron Kazmaier wrote...2008-07-07 15:17:22

Ok, two bugs. First, the PNG export module was not exporting transparent pictures properly. The rgb and alpha channels were getting scrambled (instead of rgba, it was argb). Fixed.

Second, the exporting of objects to a bitmap format did not have the ability to render to an alpha channel bitmap. The render code only supporting writting to an image which defaulted to white. Big deal to change all the render calls (clipped, patterns, gradients, alpha masking, etc) but actually ended up simplifying much of the render code which should help prevent odd bugs going on noticed etc. Added. This will be useful down the road for generating images of complex objects to be embedded in documents output to lower level devices.

Lastly, the two filters (ILBM and PNG) which supports alpha channel exporting had to be updated to report to the export rendering code that they support alpha channels.


[Status updated to 'Fixed in 5.0.4.21' on Mon, 07 Jul 2008 15:17:22 -0400]

Add a Comment
Sign in to add a comment.

Bug #237 - png export does not preserve transparency by Tim Doty   png export transparency
  created:2008-07-04 15:25:38   last updated:2008-07-04 15:25:38
  Copyright © 1985-2024 GrasshopperLLC. All Rights Reserved.


sign in to add a bug