Quick summary: identify -format "%f: %Q\n" a.jpg b.jpgįor the particular task in this question - determining a reasonable quality to save at so things look roughly the same quality - the answer by Rolazaro Azeveires is more than sufficient: just use ImageMagick's guesstimate of image quality with the identify command. It should IMHO be very obvious that neither file size nor ImageMagick's quality level are suitable to judge the true quality of an image file. Let us assume that we have the same image from a different source and for this file, ImageMagick reports a quality of 99 and the file size is 21.470 bytes: Yes, the quality is not exceptionally good, there are some visible artifacts and ImageMagick reports a quality of 62 while the file size is 17.426 bytes:
The only reasonable way to judge the quality of a JPEG file is to look at it and not to rely on some magic number procuded by a software tool. Here are for example the quality reported by ImageMagick for some different options when saving an image from Photoshop: Photoshop ImageMagick identify -verboseĪs you can see, even within one software, two different functions 'save image' and 'save for web and devices' are both using different quality level scales and neither match the quality level reported by ImageMagick.Īddition: Since Chris H tries to argue that the quality level as reported by ImageMagick can be useful in some cases, I will show some examples why that is not the case. Analyzing the file later with ImageMagick is likely to give you a very low quality level, since ImageMagick only sees a few quantization tables and does not realize that actually only a small number of quantization tables was necessary to save the file at a high quality setting. ImageMagick calculates its own quality-index based on the number of quantization tables in the image file and this number may again differ from the quality level you actually set when saving the image.įor example, if you have a structurally simple image, the simplest being a single-coloured tile, and you save it at level 100 with a software using a perceived quality index, the software can save the image essentially lossless with only a small number of quantization tables. If you use ImageMagick as suggested by Rolazaro Azeveires, it will indeed print a quality-number, but this number is not based on EXIF data. The actual result when saving a JPEG with compression level 60 in one software can differ significantly from what another software produces when set to level 60. Supposing your source image is called “input.jpg,” and you want to create “output.No, you can not and it does not make sense to do so, since there is no ubiquitous definition of the JPEG compression level.
(These could be in separate directories, but you’ll need to specify relative paths in that case…we’re keeping this example simple for command line novices.) Put the image(s) you want to convert and the eink-*.png images in the same directory, then “cd” to that directory. But if you really need it, refer to the ImageMagic documentation for image resizing. ImageMagick does have scale and crop functions, but that’s a whole added layer of complexity…you’ll probably have an easier time using GUI tools, most operating systems have something basic included. We’ll assume your source image(s) are already sized for the e-ink display (check the specific product page for your display’s dimensions, there’s a variety). BMPs, because that’s what CircuitPython works with…it’s a relatively easy image format for microcontrollers to handle. We’ll ask ImageMagic to output everything as.