Perceptual Image Compression #2775
BezPowell
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
|
Thanks for sharing this! I do think that we could be better about allowing code to be generic over encoders, though it is a tricky area because different formats have different sorts of knobs. Like, we'd probably want to keep the same API across both lossless and lossy encoders (and formats like WebP that support both!) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For some time now, there's been an active feature request to add perceptual image compression to Zola (a static site generator) in the same vein as tools such as jpeg-recompress and pio. This week, I started work on a small library to hopefully provide that for a number of lossy encoders in the image crate; the library is essentially a very thin wrapper over the
imageandimage-comparecrates, that allows running a binary search over a number of different encoder 'quality levels' to find which one most closely matches a target SSIM value.While it would theoretically be possible to just make an external call to one of the aforementioned projects, I thought it would be more useful in the long run to write a library that tightly integrates with image-rs, and is generic over encoders to allow easily adding others in future. The primary aim is for integration with Zola, but I would like to make the API generic enough to be useful to other projects.
My motivation for posting this here is two-fold: In the hope that it might be useful to others, and to ask for feedback on the API if you do use it; how easy / hard is to integrate into other projects? Is there any functionality missing that you would need? Could I make a better choice of default values?
While I feel I'm getting reasonably competent writing rust, I'm far from an expert, and image encoder internals are still well beyond me. Any feedback from those more knowledgeable on the subject would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions