Forum Moderators: not2easy

Message Too Old, No Replies

Can i use the png format?

for websites

         

one_mind

10:04 am on Jul 7, 2006 (gmt 0)

10+ Year Member



Hi,

Just wondring if png files are supported by most browsers.

Thanks :)

DanA

11:33 am on Jul 7, 2006 (gmt 0)

10+ Year Member



Transparency is not supported by some browsers (MSIE 5.x, 6). There are workarounds but they sometimes fail.

adb64

11:56 am on Jul 7, 2006 (gmt 0)

10+ Year Member



I use PNG for a long time already on my site.
But I don't use transparency in any of them. I started using them at the time when GIF creation was abandoned from PHP. And now GIF support is back in PHP I still use PNG without any problems.

monkeythumpa

5:57 pm on Jul 7, 2006 (gmt 0)

10+ Year Member



There are javascript filters for IE that work great. I have resigned myself to the fact that my site will look bad to those with JS turned off, but they have bigger problems than my rounded corners not showing up nicely and background images being clipped.

choster

7:06 pm on Jul 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Binary transparency (on/off transparency, like you find in GIF) is supported in IE. It's alpha transparency that requires the filter.

one_mind

3:37 am on Jul 8, 2006 (gmt 0)

10+ Year Member



Thanks guys :)

bbmatt

10:20 pm on Jul 8, 2006 (gmt 0)

10+ Year Member



There's other quirks with PNG aside from transparency :-

[hsivonen.iki.fi...]

The overview from that URL:-

Browsers have supported the PNG bitmap format for quite some time. But still, even though PNG files can either be made smaller than GIFs or, alternatively, can contain more colors, lots of Web designers keep using JPEGs and GIFs. In fact, even designers who (for other reasons) don’t care about old browsers still often haven’t made the switch to PNG. Is it just about being stuck with the old ways or is there a good reason not to switch? Sadly, it turns out there is a reason not to switch: gamma “correction” gone wrong.

There is no way of making PNG images that match CSS colors in all PNG-supporting browsers. This reduces the usefulness of the otherwise excellent image format. If the image colors and the colors defined in a style sheet need to match, it is safer to use GIF or JPEG. If you want to use PNG and don’t care about older browser versions (pre-Tiger Safari in particular), the best course of action is removing all the color space information from the PNG files. If you only want a match with the background color, you could make the background a PNG image as well.

Ardfry

3:11 pm on Jul 10, 2006 (gmt 0)

10+ Year Member



This is the paragraph following the above quoted text in the same article.

However, in cases where matching image colors with surrounding page colors is not of utmost importance, PNG images are safe to use. This not only means cases where the image is an independent rectangle but also cases where alpha blending is used.

It's not quite as dire as the previous two quotes alone make it sound. The saving in page load times can be dramatic when a highly optimized PNG replaces a GIF. I used a PNG instead of a GIF in the A List Apart style sheet design of a drop shadow effect, and the difference in file size was significant.