Hacker News new | ask | show | jobs
by blopker 805 days ago
The macOS integration on this app is impressive, but the technical compression bits are a combination of ffmpeg and off-the-shelf image compression libraries. The 90% number is a pretty typical (with lossy) image savings when taking a totally unoptimized jpeg out of a program like Photoshop. There's just a bunch of extra data that can be stripped out (EXIF for one), that doesn't affect how the image looks. For video, I have no idea. Handbrake can usually get me around 50% savings with the same resolution and frame rate.

ImageOptim is a good example of a nice UI on top of image compression libraries. Sadly, it hasn't been kept up to date. It's slower and compresses worse than what's possible now. It also doesn't support webp. For my own work, I made an open source clone[0] with the newest stuff in it. I use libcaesium, which is a Rust wrapper around all the compression libraries. Check out the source to see how easy it is.

[0]: https://github.com/blopker/alic

2 comments

EXIF metadata accounts for so little of the overall file size it isn't even worth mentioning...
Maybe, maybe not, but there are additional reasons to strip EXIF data. For example, many phones add location data to the images they produce. Posting those images unoptimized online can be a major privacy issue.
This depends on the size of your file. If you have dozens or hundreds of small sprite/UI images for an app or game, image metadata can add up quite a bit overall.
Dude this is perfect. I’ve been looking for a modern image optim on and off for years. Thank you for putting in this effort, this will be a huge timesaver for me.