cshum / imagor

Fast, secure image processing server and Go library, using libvips
Apache License 2.0
3.44k stars 138 forks source link

[Question]: jpegtran, MozJPEG optimizers #456

Open rela589n opened 3 months ago

rela589n commented 3 months ago

Hi there!

I'd like to ask about imagor's available image optimization options.

In Thumbor there's particular feature that's available - jpegtran optimizer. I haven't tested it myself, but currently I seek for a tool that besides the rest of the functions would allow image size optimization and that's why I ask if there's native support from imagor, since I haven't found any mention in the README?

Also, I see that there's -vips-mozjpeg option that enables MozJPEG compression. Is it natively bundled in the docker image, or is it necessary to build a custom docker image to have this option available?

FWIK, mozjpeg seems to do a better compression, while taking more time compared to jpegtran. If possible, I would really appreciate it if you could share from your own experience what size reduction we could expect from these image optimizers.

Thank you

cshum commented 3 months ago

If MozJPEG is being complied on host machine, -vips-mozjpeg would enable MozJPEG compression. Other it would be no effect.

MozJPEG is currently not bundled with docker image, due the default libjpeg-turbo being used by many other dependencies, and we have yet to make it work alongside with other dependencies. https://github.com/cshum/imagor/blob/master/Dockerfile

However if anyone manages to make MozJPEG complie successfully alongside all the other dependencies within the Docker image, I am all for a PR.

rela589n commented 2 months ago

Got it,

Thank you!