1

Is there a way to define the "quality/amount" of compression in ffmpeg with the mjpeg codec? Like -crf can be used with videos.

i.e. (mjpeg codec)

ffmpeg -i input.jpg output.jpg

produces a well compressed image, although it is slightly too compressed, what parameters can be tweaked to perform less/"better" compression?

Is there a better tool or library than ffmpeg?

user17319252
  • 165
  • 2
  • 9

1 Answers1

1

You could use ImageMagick like this:

magick input.jpg -quality 82 result.jpg

You can also control the chroma sub-sampling if you really want to. Check the actual quality with:

magick identify -verbose image.jpg      # or, more specifically
magick identify -format %Q  image.jpg
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432