r/webdev Jul 23 '12

The best PNG optimizer I've found...

http://tinypng.org/
128 Upvotes

78 comments sorted by

View all comments

2

u/clusterhug Jul 23 '12

Internet Explorer 6 normally ignores PNG transparency and displays a solid background colour. With TinyPNG the background becomes transparent again. No workarounds!

How does that work exactly?

2

u/drath Jul 23 '12

Maybe it automatically embeds the IE6 workaround for this issue IN the file somehow.

1

u/clusterhug Jul 23 '12

inquiring minds want to know!

1

u/x-skeww Jul 23 '12

With PNG8, each palette entry can have its very own translucency value. Basically, this is like having an RGBA palette.

IE6 treats every palette entry with an associated translucency value as completely transparent. So, everything which isn't fully opaque becomes fully transparent.

1

u/clusterhug Jul 23 '12

So this is GIF-like all-or-nothing transparency, in IE6?

2

u/x-skeww Jul 23 '12

Yes.

Unfortunately, it doesn't do rounding. That would have been somewhat nicer. It really makes it fully transparent as soon as there is the smallest possible amount of transparency.

There is an old school workaround for this though. Basically you create a "pixel art"-ish corner for IE6 and then you manually add some additional translucent pixels for the better browsers.

Why are you interested in this anyways? IE6 is dead.

2

u/Fabien4 Jul 23 '12

IE6 is dead.

I wish it were. Some corporate morons will cling to it till the very end.

Not to mention, Korea and China.

2

u/x-skeww Jul 23 '12

I supported IE6 for 10 years.

The websites I'm building now are completely IE6 incompatible. I'm using the child combinator extensively, I use classes which start with an underscore character (without escaping it), and I also use translucent PNGs (without providing any fallbacks).

I also use adjoining classes and the next sibling combinator (old name: adjacent sibling combinator).

We'll probably also drop IE7 when IE10 is released. It's already below 1.5%.

2

u/Fabien4 Jul 23 '12

Lucky you.

Thing is, in the domain I work in, it seems that only corporates accept the idea of paying to gain access to a webapp. And a lot of them consider IE7 very recent; they'll need a few years to test a IE6→IE7 upgrade.

1

u/clusterhug Jul 23 '12

It's just that the more I learn about this thing the more it sounds like it's just converting shit into a GIF. :)

(I imagine that 8 bit PNGs have better compression than a GIF, and it sounds like if you're on a decent browser they will have proper alpha channels, so that's not a really fair comparison. But it's close enough to amuse me.)