Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug 24bit PNG transparency ignored
5 replies. Latest Post by metal on March 16, 2009.
(0)
SharpGIS
Contributor
3397 points
611 Posts
02-18-2009 6:34 PM |
Although transparency in 1, 2, 4 and 8bit PNGs in Silverlight is horribly lacking (was told this was by design *sigh*), I was under the impression that PNG24 and PNG32 were good to go.
However I just found a case where a PNG24 image is not reading the transparency bit correctly. Instead the image is filled with white space.
Below is the image displayed on a green background which confirms that the image is transparent, and the webbrowser at least reads it correctly:
Link to image
If I load this image in Silverlight, the image will not be transparent.
Yes I know I can manually change this file to make it work in Silverlight, but the fact is that these images comes from a service that I have no control over, and they are perfectly valid transparent images (even Vista's thumbnails shows them as transparent).
Lars Buc...
Participant
1677 points
336 Posts
02-18-2009 6:56 PM |
I´ve noticed simular things,but not only for 24 bit png, there is definetly a bug in the graphics library for SL, for the images were perfrctly shown even in Blend.Recompressing with pngauntlet was fine for me , but , as you mentioned , will not make it for you
I think a bugreport at http://connect.microsoft.com/visualstudio would be a good idea
StefanWick
2864 points
438 Posts
02-27-2009 1:09 AM |
Thanks for the feedback. We are aware of the limiation. It's technically not a bug, though, it is not a supported/enabled scenario in the current release.
We are considering support for this in a future release.
Thanks, Stefan Wick
02-27-2009 6:59 PM |
Technically not a bug? In that case your documentation is technically wrong.
From http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapimage(VS.95).aspx :
-------------------------------
Silverlight does not support all possible color depths that are included in the PNG specification. The following are the PNG color depths supported in Silverlight:
Indexed color: 1-bit, 4-bit, or 8-bit color depth (per channel).
Truecolor: 24-bit color depth, or 32-bit color depth (per channel) for truecolor plus alpha.
--------------------------------
As I understand it, it says 24bit with alpha should be supported. What makes this worse is that it sometimes works, sometimes it doesn't. If that's not a bug, I don't know what it is.You could at least be consistent.
I'll cast my vote for you to add support for alpha in 4 and 8 bit images as well. Your PNG support is so poor that it causes us a lot of issues with exisiting data, and this half-baked support is just plain bad. Serving up 32bit images is just way too overkill and doesn't allow us to optimize the downloads (considering you don't support GIF either).
03-02-2009 9:57 PM |
We don't currently support palette based PNG transparencies for 24bit. I'll make sure the docs get updated to reflect that.
metal
1243 points
262 Posts
03-16-2009 1:15 PM |
StefanWick:We don't currently support palette based PNG transparencies for 24bit. I'll make sure the docs get updated to reflect that.
is there any other way to format the image so we get clean transparencies as gradients ?
Very anoying as the image looks fine in VS2008 xaml editor but horible when executed in the browser. ( large image where 80% is a very smooth transparent gradient fading out, in the browser this fading is in large sharp steps of specific levels of transparency)