699 karma · joined October 8, 2013
Projects: https://optimage.app https://designplugins.com
> Use WebP! For everything!
Jyrki Alakuijala, one of the creators of WebP, on WebP vs JPEG [1]:
>> For high quality photography, I (and butteraugli) believe that JPEG is actually better than WebP.
>> Below JPEG quality 77 WebP lossy wins, above JPEG quality 77 JPEG wins (for photography).
>> This was based on the maximum compression artefact in an image -- averaging from 1000 images.
Better meaning here [2]:
>> Faster decode (up to around 6x faster) and less bytes needed at high quality (in comparison to butteraugli scores).
[1] https://encode.ru/threads/2905-Diverse-third-party-ecosystem...
[2] https://encode.ru/threads/2905-Diverse-third-party-ecosystem...
And noticeably degraded if you compare those images with the originals. Optimage does apply chroma subsampling, the major winner here, when it makes sense.
My goal is automatic image optimization with predictable visual quality, i.e. images have to remain authentic to originals.
> your closed source tool
FYI, ImageOptim API is closed source and way more expensive if that was your point.
> Your benchmark is not a legitimate comparison
If you have a better one,
> then post the results
I did post mine. Just why are you taking them out of context and missing others, e.g. lossless compression results?
I have raised a number of issues [2] with this guide. It’s been over a year and they still have not been addressed [3].
[1] https://getoptimage.com/benchmark
[2] https://github.com/GoogleChrome/essential-image-optimization...
[3] https://twitter.com/addyosmani/status/914207017589288960
Sketch exists thanks to the genius of Quartz / Core Graphics. It does not have a rendering engine per se and struggles even with path ops [1].
This technical debt may soon be the end of Sketch. Because apart from Adobe, there is now Figma with smart people like Evan Wallace who can really "decide" [2][3].
With C++ core, Figma can go fully native [4], and it's puzzling why they have done this already.
[1] https://twitter.com/vmdanilov/status/892358827378696194
[2] https://www.figma.com/blog/building-a-professional-design-to...
[3] https://medium.com/@evanwallace/easy-scalable-text-rendering...
[4] https://twitter.com/evanwallace/status/673959396104273921
Some very smart people at Google go to the trouble of creating projects like Guetzli. I personally have spent months on this, and it gets me every time someone claims "just use that one tool" without any evidence. I presented mine and it's reproducible.
ImageOptim is a great tool otherwise.
In practice some images can get noticeable artifacts even at around 90. Most of JPEG compressors always apply chroma subsampling which is often destructive on its own [1]. On the contrary, many hidpi images can be compressed at around 50.
> Use Progressive JPEG… Thanks to this, a visitor can roughly see what’s in the image way earlier.
That's not the point of using progressive JPEGs nowadays. The 10-200% decompression slowdown is for the 5-15% size reduction.
> Use Interlaced PNG.
Don't. Interlaced PNGs can easily be 1/3 bigger. There are better ways to show loading images, and it's already used on the website.
> webpack has image-webpack-loader which runs on every build and does pretty much every optimization from above. Its default settings are OK
> For you need to optimize an image once and forever, there’re apps like ImageOptim and sites like TinyPNG.
These tools are no good for automatic lossy image compression [1]. The default is mostly JPEG 4:2:0 at quality 75, PNG quantized with pngquant at settings as low as conscience allows, missing out many PNG reductions and optimal deflate, no separation between lossy and lossless WebP if at all, etc.
As a result, the images on the website have about 13-24% more to optimize losslessly.
Only that ImageOptim ruined most of JPEG images while PNG images are ~7.5% bigger.
> imageoptim is dramatically smaller on all of them
There are myriad ways to make them much smaller at the cost of visual quality: blurring, posterization, rescaling, etc. The question is where to stop. With visually lossless, you can apply these techniques in advance and have predictable results. For example, Optimage does choose chroma sampling when it is not destructive to original.
> the 'broken gradient' (I can't see it)
It can be seen on a calibrated display, sorry.
> the orange sneakers (imageoptim's looks better and not overblown colors)
Original colors are "overblown" [1].
> or the rotated beach scene
It is rotated.
It looks like Firefox still does not treat untagged images as sRGB and the difference on wide-gamut monitors may be noticeable.
That was a matter of an option switch. It should be fixed now. Thanks.
On a side note, HN voting system is horribly broken. I submitted the link in the morning and when I hit the bed it somehow got attention.
The work on a cross-platform GUI is happening too, but it is way slower than I anticipated. It's going to be native or nothing. I don't consider Electron or QT as an option.
[1] https://brave.com/new-brave-browser-release-available-for-ge...
[2] https://user-images.githubusercontent.com/3129436/47203976-b...
[3] https://user-images.githubusercontent.com/3129436/47203978-b...
[1] PNG24 199 144 bytes
[2] JPEG 94 699 bytes
[3] PNG8 47 155 bytes
[1] https://user-images.githubusercontent.com/3129436/47068394-d...[2] https://user-images.githubusercontent.com/3129436/47068393-d...
[3] https://user-images.githubusercontent.com/3129436/47068392-d...
[1] https://developers.google.com/speed/webp/docs/webp_lossless_...
Also, most of those savings came from near-optimal Deflate compression.
Pngcrush is rather limiting though. I could compress the PNG textures by ~8% more with optimage [2] (I'm the author).
And for newer browsers, serving the textures as brotli-compressed BMPs would actually make them >30% smaller (probably more with filtered but uncompressed PNGs).
[1] http://www.sublimetext.com/~jps/animated_gifs_the_hard_way.h...
There are also 156KB of images waiting to be compressed to one third of that [1].
Image formats are not used wisely: [1] is PNG not JPEG and [2] is JPEG not PNG.
> I found that setting quality (mozjpeg) to 70 produces good enough images for the most part, but your mileage may vary.
You can get away with this setting for hidpi sizes but 1x will look horrible [1]. If you care about quality, the mileage is actually 75-95.
> (Pngquant) quality level of 65-80 to provide a good compromise between file size and image quality
Again, it may only be applied to hidpi sizes, and it will easily ruin any gradients or previously quantized images.
Pngquant is a great color quantization tool but it does not actually perform any lossless PNG optimizations, which can save you at least 5% more, and up to 90% in some cases.
All of these tools will also blindly strip metadata (but it's not guaranteed!) along with color profiles and Exif Orientation resulting in color shifts and image transformations respectively.
Most importantly, none of them are good enough for automatic lossy compression. Guetzli is the closest but it still has some severe issues [3]. I'm also trying to build a real thing, and it is hard.
> there’s value in using WebP formats where possible
WebP lossless and WebP lossy are quite different formats. WebP lossy being always 4:2:0 is not a good replacement for JPEG [4] especially at higher quality. On the contrary WebP lossless has evolved into a decent alternative for PNG including lossy [5].
Proper responsive images would give you considerably smaller page weight and improve performance on mobile devices. BTW Google treats oversized images as unoptimized [6].
[1] https://freshman.tech/assets/dist/images/http-status-codes/e...
[2] https://freshman.tech/assets/dist/images/articles/freshman-1...
[3] https://github.com/google/guetzli/issues
[4] https://research.mozilla.org/2014/07/15/mozilla-advances-jpe...
[5] https://twitter.com/jyzg/status/958629795692150790
[6] https://developers.google.com/speed/pagespeed/insights/?url=...
There is a number of issues with each and every tool you mentioned, e.g. color information stripped with metadata causing color shifts in wide-gamut and non-sRGB images, camera images changing orientation when Exif stripped, color banding on PNGs and JPEGs even when using Guetzli (JPEGmini is not nearly as good in other cases, but Guetzli is extremely slow), unexpected dithering noise on flat PNGs, tracing artefacts on screen recorded GIFs, JPEGs being overcompressed, poor lossless compression (virtually any online service), progressive JPEGs incompatible with Photoshop, etc.
These are just some of the problems I've been solving, and yes, there are better tools.
This whole sentence is false. I did not "bully" you anywhere (!), requested a feature from you, or pressured you to do anything. Quite the opposite, I showed an easy way to improve. Again, I could have been wrong on the effect. That's why the question. The "spotlight" reference was just a small joke. Sorry.
> And then, to back up your argument, you link to a page which is not running on Ghost - and actually does have optimised+responsive images.
I meant only the Ghost homepage in the link, and better optimization (proves [1]).
> All so you can spam your own image compression app.
I gave you the facts. Yet, you smeared me with false accusations. Is this even fair?
[1] https://github.com/vmdanilov/optimage/files/2011804/ghost.zi...
[1] https://twitter.com/JohnONolan/status/941572225890533376 [2] https://ghost.org/features/ [3] https://i.imgur.com/b5OO3Q6.png
That image is a good example for any perceptual encoder. At 50% size it's 600KB (487KB with current master), and there's still a lot to be unhappy about, e.g. a hidpi image like that can be compressed a lot harder.
Over 6MB of those 10MB is just one bloated photo [1]. It can be compressed down to 1-2MB. Moreover, if it was a proper responsive image, it would not be larger than 100-200 KB for most readers because a good JPEG compressor can pull 2 bits per pixel [2].
Ironically, image optimization apps don't get that much coverage.
[1] https://techcrunch.com/wp-content/uploads/2018/05/vikbajaj20...