Essential Image Optimization
images.guide
images.guide
All too often I’ve seen people encoding 8MP photos as PNGs and wondering why they’re all 50MB in size.
Next on the hit list is outputting images at the right size. If the image is never going to be shown greater than 500px wide, save a copy that’s 500px wide. WordPress has this feature built in- learn to use it if that’s your flavour of CMS. Your bounce rate will go down, I guarantee it.
I’ve literally never seen anyone do that, leave alone this being done “often”.
Cases on the flipside includes developers using JPEG for everything. 100KB highly artifacted illustrations used throughout web layouts, which would be infinitely better as clear 10KB PNGs.
I occasionally archive some imagery from web and while viewing them in Irfan I am frequently confronted with "This image is JPG with .png extension, would you like to rename it?" prompt, without what I'd probably had no idea how frequently this discrepancy occurs.
> All too often I’ve seen people encoding 8MP photos as PNGs...
And now apparently it's some CMS that was doing that... which doesn't make much sense either. Either way this is just such a patently and obviously dumb thing to do that it makes me doubt your experience is anywhere close to being statistically significant.
Because cameras and phones give you JPEGs. The common user doesn't shoot RAW. I cannot see any not-highly-technical user convert JPEGs to anything else.
Fortunately, and _I can't emphasize this enough_, we're now in a situation where the major browsers support Webp or can have fast decoding support easily added. Webp is based on the I-frame encoder of VP8, and for lossy encoding represents a several-generations improvement over Jpeg. And it's here today. Sure, we'll all be using Avif in a HEIF container one of these days, but that isn't relevant to people building systems today.
Use WebP! For everything! Check out some comparisons between WebP and MozJPEG here: https://xooyoozoo.github.io/yolo-octo-bugfixes/#buenos-aires...
I now upload WebP and HEIC images to Google Photos, where they are both supported.
Until it does people will probably still be shipping jpg/png as standard.
In addition, all modern browsers support the <picture> element, which allows them to automatically download image the best meets their needs.
The <picture> element is great but using it means not, as you wrote, "Use WebP! For everything!" Maybe you meant "Use WebP! For everything! With Fallbacks!"
I can get behind that. :-)
What I meant by "for everything" was to use it for both photographic images and illustrations instead of using two different formats.
> 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...
That's interesting. Of course, the subjective part of that is one person's take, and the "objective" part of it is pointless because the whole point of Guetzli (the jpeg encoder) is to try to maximize the Butteraugli score, so saying that WebP gets a lower score is not significant.
Personally, WebP looks a lot better to me in the direct tests of equal file size that I've seen. It even looks better than Pik, which is Google's experimental successor to Jpeg that also uses Butteraugli.
And it would be odd, to say the least, if a codec from the early nineties could beat a modern one on Intra-frame coding, which has been a subject of immense research over the years.
Take a look at some of these for yourself. https://wyohknott.github.io/image-formats-comparison/
So my advice is encode in multiple formats to achieve the broadest browser support and the best image quality/size trade off that you’re willing to allow. That said... it does sort of bug me that every couple years we have to revisit which codecs we’re using because the implementations keep marching on...
That's the sort of faux-professional hyper-contrarianism that is "bordering on detrimental".
I just checked Magnum, a somewhat professional photo agency. They use JPEG. So do the NYT, flickr, and probably the vast majority of professional and totally unprofessional websites.
It seems there is some use left in the format. Not being able to print to billboard sizes doesn't diminish this. Because (a) that use case is a rounding error, and (b) WebP is still not safe for such purposes – TIFF is.
That you find web using hardcore old style JPEGs when they've been replaced by better formats long ago also doesn't mean that JPEG is really suitable way to store or share photos - especially when your display is good hi-dpi stuff. Also - do you find GIFs technologically OK for sharing animations today when there is stuff like h.265...?
- use of `<details>` and `<summary>` elements for native web dropdown (see Table of Contents)
- works/looks just as great with js disabled
- package.json: {..., "main": "index.md", ...}
- very informative README, including notes on how he builds the site, https://github.com/GoogleChrome/essential-image-optimization...
I wrote and maintain imagemin-webpack-plugin for optimizing images during the build process for webpack-based javascript projects. It works using imagemin and the various plugins for it, which themselves are just small wrappers around most image optimizers.
https://www.macleans.ca/society/technology/canadas-almost-th...
My grandfathered $140/month mobile plan has 14GB of data; 320MB is 70% of a day's bandwidth, or 2% of the month's.
If I wanted to add another GB I could accrue $100 in overages ($0.10/MB), or pay another $25/month. But Bell will charge for another month in advance if you change the current month's plan.
Strangely enough it was only $5/month to up it from 13GB to 14GB :<
All this despite being able to download at 7MB/s; I could blow my cap in half an hour, and another half hour would cost $1,400 if I didn't up the plan.
Edit: I use my cellphone's data heavily, but 20, 40, 50GB cable internet caps are common with a lot of people not understanding what that means for streaming video / downloading pictures.
Bonus if it's <5k$
https://webmproject.github.io/libwebp-demo/webp_wasm/index.h...
WebAssembly is a nice way to add support for image containers and formats which don't have browser support yet.
Typical users wouldn't be able to view downloaded images; they could only see them through your site.
I'm not sure on the details of web assembly, but if you can obturate the workings then this technique becomes stronger, can web assembly be delivered compiled?
My understanding was that progressive JPEG actually feels slower, since users are less sure when the image has finished loading, and are thus best avoided in most cases.
I am really glad we invested in automated image optimization where I work. We run a couple of large real-estate websites and we store tens of millions of images and process thousands a day. Optimizing all of them from the start was one of the best things we did.
When an image gets uploaded, we re-encode it with MozJPEG and WebP and then create thumbnails in five different sizes and upload them all to S3. They get served through a CDN. We initially did the re-encoding and scaling on the fly and then cache them forever. But MozJPEG is really slow so we changed the system to pre-process everything.
When we first implemented this two years ago, Chrome was the only browser that supported WebP. This investment really paid off as all major browsers now support WebP. The website loads really quickly and images rarely give us problems.
We're heavy users of Python and we're using the excellent Pillow-SIMD [1] library to do most of the heavy lifting. We made our own builds to link it to MozJPEG instead of libjpeg and include libwebp.
Do check on-the fly optimisation tools like https://www.gumlet.com You can save a huge amount in server costs as well as developer and devops team time. Basically all image operations are done in the cloud and all images are served via super fast CDN - that too with cheaper price than a CDN.
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
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?
See https://twitter.com/nothings/status/1102726407744978944 for some concrete examples.
EDIT: I am not an expert on licensing but it does look like everything is in order from a licensing perspective (the original content is CCA3 and to me it looks like things are credited properly).
Should I reach out to an admin to get this removed?
Why should I pick Gumlet over alternatives? There are a lot of competitors such as kraken.io
- cheaper pricing and no minimum monthly payments
- global image processing locations - ensures lowest latency regardless of location of your users
- no lock-in and wide variety of cloud storage support including DigitalOcean Spaces
- prompt support - less than 8 hour response time for all users
- GIF support
- especially compared to kraken, we charge only $0.1 per GB compared to their lowest pricing of $1 per GB
- strong enterprise focus - lot of features planned for enterprise support.
Are there plans for a self-hosted option? Some business might be scared of being so dependent on Gumlet's uptime for their mission critical image processing.
Gumlet seems to cater towards processing images on the fly, which is what a lot of your competitors also do. It might be interested to also cater towards using Gumlet as a service to pre-process images as part of a pipeline.
I am just thinking aloud, I have no real basis for these ideas at the moment. Just my two cents.
I wish you the best of luck and I'll keep Gumlet in mind, the homepage looks very sleek.
Cloudinary Fetch pulls images from your S3, caches them, and serves the size and format you request all without touching the original files
It's classic build vs. buy dilemma. In majority of cases it's much more cost effective to buy.
BTW, Uploadcare doesn't charge for file processing at all, only for CDN traffic. So you can create as much image variants as you need.