Live data from Hacker News

Instant 8-bit alpha PNG converter

8bitalpha.com

11–20 of 27 posts

Re: Instant 8-bit alpha PNG converter

#11
post #10
post #5

What is the difference to using say optipng?

Here's a real example, using a test image that has a lot of different alpha values in it, and a 24-bit alpha channel: Original: 87047 bytes optipng -o7: 82489 bytes this tool: 22585 bytes The main difference, other than size, is that optipng produced an exact copy of the the original, while this tool is lossy, and threw away a bunch of data from the alpha channel. The win is that for the majority of all web cases, 8…

Note that it's not perfect for all cases, but it's certainly acceptable for small icons.

Here's a 32x32 icon I converted down to 8-bit alpha and then 1-bit, and then resized the whole group so they could be more closely examined:

http://i.imgur.com/XTksy.png

Re: Instant 8-bit alpha PNG converter

#13
I've got improved pngquant that gives significantly better results than original version, gd2 library and often rivals pngnq:

https://github.com/pornel/improved-pngquant

It is a bit slow (converts image several times feeding back result's quality back to the algorithm), but difference in quality is significant:

http://geekhood.net/8bitalpha.png - converted via website

http://geekhood.net/imagealpha0.7.png - converted with pngquant 1.3

Re: Instant 8-bit alpha PNG converter

#14
Wow, I go on holiday away from a decent internet connection and next thing you know, HN front page. Urk.

Hope it all works well for everyone. As mentioned, the source is all on github (https://github.com/thingsinjars/8bitalpha) so if there are any improvements, fork away.

I'll try and keep an eye on it in case something breaks but I'm a bit limited to an iPhone SSH client on a foreign country's network so play nice. :D

I'm glad people are finding it useful, though.

Re: Instant 8-bit alpha PNG converter

#15
post #10
post #5

What is the difference to using say optipng?

Here's a real example, using a test image that has a lot of different alpha values in it, and a 24-bit alpha channel: Original: 87047 bytes optipng -o7: 82489 bytes this tool: 22585 bytes The main difference, other than size, is that optipng produced an exact copy of the the original, while this tool is lossy, and threw away a bunch of data from the alpha channel. The win is that for the majority of all web cases, 8…

Actually, making good palette for PNG8+a is very difficult, because in PNG8 alpha is not an additional channel, but property of palette entries. Instead of 256 RGB colors in palette you have 265 RGBA colors, so e.g. red and semitransparent red are two distinct entries.

Re: Instant 8-bit alpha PNG converter

#16

Wow, I go on holiday away from a decent internet connection and next thing you know, HN front page. Urk. Hope it all works well for everyone. As mentioned, the source is all on github ( https://github.com/thingsinjars/8bitalpha ) so if there are any improvements, fork away. I'll try and keep an eye on it in case something breaks but I'm a bit limited to an iPhone SSH client on a foreign country's network so play nice…

Great work, many thanks for the source.

Ah, now I see it's a far cry from pngng/pngquant

https://github.com/thingsinjars/8bitalpha/raw/master/image.p...

Some php gd2 conversion, gets the job done but it's not as sophisticated.

Still, huge potential to slide in other solutions, even via shell.

Re: Instant 8-bit alpha PNG converter

#17
post #4

Thank you a lot for the tool. I had no idea I could compress PNG so much, without loosing too much quality. I will be a heavy user of this.

To clarify, I didn't make this site, just discovered it while googling how to accomplish this without Fireworks. The "beauty" of 8-bit png is how it degrades acceptably in IE8, IE7 and even IE6. Try comparing a large round icon in 1-bit alpha (ie. gif) vs 8-bit alpha, it's much much better.

IE7 and IE8 can display 32bit (24bit for RGB + 8bit for alpha channel) PNGs fine by the way. IE6, of course, only supports alpha transparency on 8bit PNGs.

Re: Instant 8-bit alpha PNG converter

#18
post #11
post #10

Earlier quoted context omitted.

Here's a real example, using a test image that has a lot of different alpha values in it, and a 24-bit alpha channel: Original: 87047 bytes optipng -o7: 82489 bytes this tool: 22585 bytes The main difference, other than size, is that optipng produced an exact copy of the the original, while this tool is lossy, and threw away a bunch of data from the alpha channel. The win is that for the majority of all web cases, 8…

Note that it's not perfect for all cases, but it's certainly acceptable for small icons. Here's a 32x32 icon I converted down to 8-bit alpha and then 1-bit, and then resized the whole group so they could be more closely examined: http://i.imgur.com/XTksy.png

I was able to convert it without noticeable degradation down to 7 bit:

http://geekhood.net/bitcoin-32bit.png

http://geekhood.net/bitcoin-7bit.png

(using my pngquant)

Re: Instant 8-bit alpha PNG converter

#19
post #18
post #11

Earlier quoted context omitted.

Note that it's not perfect for all cases, but it's certainly acceptable for small icons. Here's a 32x32 icon I converted down to 8-bit alpha and then 1-bit, and then resized the whole group so they could be more closely examined: http://i.imgur.com/XTksy.png

I was able to convert it without noticeable degradation down to 7 bit: http://geekhood.net/bitcoin-32bit.png http://geekhood.net/bitcoin-7bit.png (using my pngquant)

Yah, after looking at the source I saw they are only using php's gd2 library on 8bitalpha.com which is definitely inferior to your work.

The problem is lack of Windows binaries, this is the most modern I can find:

http://sites.google.com/site/bitdepthtools/downloads

BTW this is the original image I am resampling down to icon size, it seems very challenging because of the multi-layered round edges and many gradients internally:

http://en.wikipedia.org/wiki/File:Bitcoin.png

Re: Instant 8-bit alpha PNG converter

#20
post #17
post #4

Earlier quoted context omitted.

To clarify, I didn't make this site, just discovered it while googling how to accomplish this without Fireworks. The "beauty" of 8-bit png is how it degrades acceptably in IE8, IE7 and even IE6. Try comparing a large round icon in 1-bit alpha (ie. gif) vs 8-bit alpha, it's much much better.

IE7 and IE8 can display 32bit (24bit for RGB + 8bit for alpha channel) PNGs fine by the way. IE6, of course, only supports alpha transparency on 8bit PNGs.

  IE6, of course, only supports alpha transparency on 8bit
  PNGs.
IE6 does not support alpha transparency, in this case it treats colos with alpha component as fully transparent i.e. PNG8 with alpha transparency is treated as with index transparency.
Post reply on HN