Programmtically choosing image conversion format to JPEG or PNG for Silverlight display

Posted by Otaku on Stack Overflow See other posts from Stack Overflow or by Otaku
Published on 2010-05-13T01:00:17Z Indexed on 2010/05/13 1:04 UTC
Read the original article Hit count: 289

Filed under:
|
|
|
|

I have a project where I need to convert a large number of image types to be displayable in a Silverlight app - TIFF, GIF, WMF, EMF, BMP, DIB, etc. I can do these conversions on the server before hydrating the Silverlight app.

However, I'm not sure when I should choose to convert to which format, either JPG or PNG. Is there some kind of standard out there like TIFF should always be a JPEG and GIF should always be a PNG. Or, if a BMP is 24 bit, it should be converted to a JPEG - any lower and it can be a PNG. Or everything is a PNG and why?

What I usually see or see in response to this type of question is "Well, if the picture is a photograph, go with JPEG" or "If it has straight lines, PNG is better." Unfortunately, I won't have the luxury of viewing any of the image files at all and would like just a standard way to do this via code, even if that is a zillion if/then statements.

Are there any standards or best practices around this subject?

P.S. Please don't move to close this subject - it actually has no duplicate on SO because I'm not looking for subjectivity.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about image