Skip to main content

Microsoft Silverlight

Answered Question 24bit PNG transparency ignoredRSS Feed

(0)

SharpGIS
SharpGIS

Contributor

Contributor

3397 points

611 Posts

24bit PNG transparency ignored

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:

24bit PNG 

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).

--
/Morten | blog - twitter
Please click on "Mark as Answer" if this answered your question.

Lars Buchleitner
Lars Buc...

Participant

Participant

1677 points

336 Posts

Re: 24bit PNG transparency ignored

 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
StefanWick

Contributor

Contributor

2864 points

438 Posts

Microsoft
Answered Question

Re: 24bit PNG transparency ignored

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

Microsoft Silverlight | http://blogs.msdn.com/swick/

SharpGIS
SharpGIS

Contributor

Contributor

3397 points

611 Posts

Re: 24bit PNG transparency ignored

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).

--
/Morten | blog - twitter
Please click on "Mark as Answer" if this answered your question.

StefanWick
StefanWick

Contributor

Contributor

2864 points

438 Posts

Microsoft
Answered Question

Re: 24bit PNG transparency ignored

We don't currently support palette based PNG transparencies for 24bit. I'll make sure the docs get updated to reflect that.

Thanks, Stefan Wick

Microsoft Silverlight | http://blogs.msdn.com/swick/

metal
metal

Participant

Participant

1243 points

262 Posts

Re: 24bit PNG transparency ignored

 

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)

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities