[HN Gopher] Automating Image Compression
___________________________________________________________________
Automating Image Compression
Author : ramijames
Score : 11 points
Date : 2026-01-27 07:53 UTC (2 days ago)
(HTM) web link (www.ramijames.com)
(TXT) w3m dump (www.ramijames.com)
| blopker wrote:
| This post greatly over simplifies how many issues come up
| optimizing images. Also, the Github workflow doesn't commit the
| optimized images back to git, so this would have to run before
| packaging and would have to run on every image, not just new
| images added.
|
| Ideally, images are compressed _before_ getting committed to git.
| The other issue is that compression can leave images looking
| broken. Any compressed image should be verified before deploying.
| Using lossless encoders is safer. However, even then, many
| optimizers will strip ICC profile data which will make colors
| look off or washed out (especially if the source is HDR).
|
| Finally, use webp. It's supported everywhere and doesn't have all
| the downsides of png and jpg. It's not worth it to deploy these
| older formats anymore. Jpgxl is ever better, but support will
| take a while.
|
| Anyway, I made an ImageOptim clone that supports webp encoding a
| while ago[0]. I usually just chuck any images in there first,
| then commit them.
|
| [0]: https://github.com/blopker/alic
___________________________________________________________________
(page generated 2026-01-29 23:01 UTC)