3 ms·
Regarding image compression: https://homebrewserver.club/low-tech-website-howto.html#image-compression https://homebrewserver.club/low-tech-website-howto.html#i
by lucb1e 8y ago
Regarding image compression: https://homebrewserver.club/low-tech-website-howto.html#image-compression https://homebrewserver.club/low-tech-website-howto.html#imag...
The original is 160KB. When I save it in GIMP, the re-encoding (at 90% quality be default) brings me to a baseline value of 164KB. If I turn the quality down to 50%, it appears to be almost identical but is only 72KB, less than half the size. Turning it down further until I can only barely make out more detail than in the dithered image (for example, I can see that the operator on the bottom left is looking at something, whereas in the dithered image I originally thought her face was a headphone and she was facing away from the camera), and at 7% the limit is finally reached. At 6%, the quality is no longer better than the dithered image. So at 7%, what's the size? 20.9KB, much less than the dithered image that is claimed to be 36.5KB.
I'm not sure why I double checked, but I did. You know what? The dithered image is not 36.5KB as the article claims, but a 76KB PNG. Which is impressive because with PNG, I can't get it below 140KB in GIMP. JPG and GIF also can't reduce it beyond 76KB. Their PNG encoder is much better than GIMP's, but I don't know where the 36.5KB claim comes from. What I do know is that JPG can get it to 72KB with virtually no quality loss, or 21KB at a quality still slightly higher than the dithered version. All you have to do is change the quality setting, an option available in almost every editor (no fancy tools or skills needed).
Dithering seems to be just chosen for its 1950s look, not for actual power saving.
- mistercow 8y agoWhat I find really frustrating about this is that the whole premise is supposed to be about how using older technology can be more environmentally friendly, yet they used a newer codec that simply wasn't appropriate to the task they threw at it to give the impression of "old" while wasting more resources. And to throw one final nail in the coffin, if they used a modern, but reasonably mature codec like VP8, they could have done even better on resource usage while retaining the same quality. If you want to build something to demonstrate that using older technology has advantages, that's fine. But you should make sure that you're actually demonstrating what you intended. And I'd pick something other than energy efficiency to target, because the last decade has seen a ton of technological progress improving energy efficiency because of its importance to mobile devices running on tiny batteries.
- newnewpdro 8y ago> You know what? The dithered image is not 36.5KB as the article claims, but a 76KB PNG. Incorrect, it is 36.5K: $ wget https://homebrewserver.club/images/international-switchboard3.png --2019-03-16 12:41:11-- https://homebrewserver.club/images/international-switchboard3.png Resolving homebrewserver.club (homebrewserver.club)... 87.214.157.230 Connecting to homebrewserver.club (homebrewserver.club)|87.214.157.230|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 37359 (36K) [image/png] Saving to: ‘international-switchboard3.png’ international-switc 100%[===================>] 36.48K 26.4KB/s in 1.4s 2019-03-16 12:41:14 (26.4 KB/s) - ‘international-switchboard3.png’ saved [37359/37359] When you tried reproducing the results using GIMP, were you creating similarly constrained indexed-color/paletted images? You likely won't get the same compression levels with rgb pixels, you can use `pnginfo` to compare the file properties: $ pnginfo international-switchboard3.png international-switchboard3.png... Image Width: 800 Image Length: 655 Bitdepth (Bits/Sample): 2 Channels (Samples/Pixel): 1 Pixel depth (Pixel Depth): 2 Colour Type (Photometric Interpretation): PALETTED COLOUR (4 colours, 0 transparent) Image filter: Single row per byte filter Interlacing: No interlacing Compression Scheme: Deflate method 8, 32k window Resolution: -547765670, 22093 (Unknown value for unit stored) FillOrder: msb-to-lsb Byte Order: Network (Big Endian) Number of text strings: 0
- lucb1e 8y agoHuh that's weird, my Firefox definitely reported that. I also checked the other image, that size matched perfectly with the claim in the text. My first thought is http-level compression, but that shouldn't be that effective on an average image. (I'm not at my computer anymore so I can't check what you suggested right now.)
- Wildgoose 8y agoJust a query - what about the power-saving on the users machines from easier decompression?
- lucb1e 8y agoAll I noticed is that my browser scrolled less smoothly when an image was in full view. Didn't try with the jpegs but it didn't seem particularly efficient. You could be right though, this is a subjective n=1 kind of remark.
- mistercow 8y agoI posted this elsewhere in the thread, but JPEG seems to be significantly easier to decompress than PNG. Probably mostly due to hardware being optimized for it, but it might also have to do with the way the encoding works. Decompressing JPEGs mostly relies on doing some relatively fixed operations on localized 8x8 tiles, while PNG uses DEFLATE with a window size of up to 32KB.