1
I want to be able to compress and resize and image with mozjpeg's cjpeg
command
However according to the usage file it does not seem like cjpeg
can do both in one single command.
Is it right?
If it is impossible to both compress and resize at the same time, should I use jpegtran
to perform the resize function? If I should use jpegtran
, then should the resize before or after the cjpeg
optimises?
1Perhaps I am blind, but in the usage page you link to, neither
cjpeg
norjpegtran
seem to have aresize
option? The closest thing I spotted wasdjpeg
, which has ascale
option, but that's for decompressing.jpg
images. – Anaksunaman – 2019-03-12T04:51:18.693then how can one use this toolset to scale down a jpeg image? – Anthony Kong – 2019-03-12T04:56:12.947
It seems likely you would need to use
djpeg
with thescale
option to turn the image into e.g. a bitmap of the size you wanted, then usecjpeg
to recompress that e.g. bitmap into a.jpg
format. – Anaksunaman – 2019-03-12T05:05:58.940Looks like it is a no-go because
– Anthony Kong – 2019-03-12T05:07:26.957djpeg
is not is not tested and not maintained. https://github.com/mozilla/mozjpeg/issues/309#issuecomment-440674126Ah. That's too bad. =/ – Anaksunaman – 2019-03-12T05:11:46.073
@AnthonyKong, have you consider to change the base and use ImageMagic? – Romeo Ninov – 2019-03-12T06:58:25.383