News for hackers. Stuff that matters.
Re:Lossy PNG by homosaur on Saturday August 17, 2013 @12:42PM (#6229538)
This is cool code but can someone explain why we'd need this? Do we not have a common lossy format that supports transparency? My primary concern is that people have an expectation of what PNG means and this completely subverts that.
Re:Lossy PNG by simcop2387 on Saturday August 17, 2013 @12:59PM (#6229601)
We actually don't, WebP can do this, but it's by no means common yet. This is actually a reasonable use of PNG still, it's optimizing the contents for the lossless algorithm. You might be able to take the difference/error and put it in another image and layer them to make it give back the detail.
Re:Lossy PNG by cynwoody on Saturday August 17, 2013 @03:32PM (#6230067)
PNG isn't being subverted. The lossage happens before PNG is applied.

What you are getting is a lossless copy of an image that has been cleverly preprocessed to be easier for the PNG algorithm to compress while not losing noticeable visual quality. The result is good compression and transparency support (which JPEG doesn't have).

Re:Lossy PNG by metafunctor on Saturday August 17, 2013 @12:56PM (#6229588)
That's exactly it: we do not have a commonly implemented lossy format that supports transparency.
Re:Lossy PNG by homosaur on Saturday August 17, 2013 @01:00PM (#6229608)
Yeah I only asked because I agree with the above poster that we can't consider WebP common yet but was unsure if I was forgetting something. I can see the utility in this then, at least as a stopgap.
Re:Lossy PNG by svantana on Saturday August 17, 2013 @04:30PM (#6230285)
Aren't you forgetting GIF? Not a great format admittedly, but in photoshop there's even a "lossy" slider.
Re:Lossy PNG by xsmasher on Saturday August 17, 2013 @04:37PM (#6230305)
The GIF format is not lossy. There is no "quality" option in the format itself; just a color depth option, same as PNG.

Photoshop uses the same tricks for "lossy" gif that this article uses for PNG.

Re:Lossy PNG by pornel on Saturday August 17, 2013 @04:51PM (#6230345)
I've researched lossy GIF too: http://pornel.net/lossygif but even lossy version wasn't better than PNG.

LZW is just a very poor compression. Even best case is taking ridiculous amount of bits (you can only add 1 byte to previously used pattern, so it's sequence of symbols for 1+2+3+5+6+etc. pixels resetting every 4k iterations), so there isn't even room for improvement.

So, GIF is awful. Should be forgotten.

Re:Lossy PNG by SeppoErviala on Sunday August 18, 2013 @07:04AM (#6232341)
Only reason GIF is still alive is its animation support. APNG and WEBP+animation are not there yet.

8-bit palette and crappy compression do not matter when you offer exclusive features.