I noticed some photos missing "quality" information in their metadata using ImageMagick's identify command
identify -verbose image.jpg
How can one remove this info?
This is one example
I noticed some photos missing "quality" information in their metadata using ImageMagick's identify command
identify -verbose image.jpg
How can one remove this info?
This is one example
In short: there is no reason to care about this value and it its presence does not make your file larger.
identify -verbose filename(s)
only displays the quality if the image uses the standard quantization matrix. You can use nonstandard matrix (-define jpeg:q-table=...) to make this value disappear.
The quality will be, however still displayed when the (better) command
identify -format 'the quality of %f is %Q' filename(s)
is used (better for displaying the quality that is, it only looks for this value instead of performing the detailed analysis of the image, which makes it much faster than "identify -verbose")
The thing is, you can't really remove the quality value, similarly how you can't "remove" the image width or height. It is the inherent attribute of the JPEG image and is calculated by ImageMagick from the JPEG quantization tables contained in the file.
It does not have, however, any standarized meaning. The value displayed by ImageMagick corresponds to the Independent JPEG Group's libjpeg quality setting (also used in GIMP and many others), other software packages can have their own incompatible quality measures. In such nonstandard case, ImageMagick can only estimate the quality, by looking what standard quality table is similar to the actual one. Use the "-debug All" will (among others) display the following:
Quality: 85 (exact)
or
Quality: 85 (approximate)
For some reason, "-verbose" only displays the value when it is exact, while "-format %Q" will always display the quality, even if it is just approximate.
This isn't metadata that can be stripped. It's an analysis of the compression calculated from the quantization tables. When it's comes back unknown, the jpeg was compressed using a program that isn't known to identify
.
Edit: Upvotes for @szulat answer, much more detailed than mine.
As stated by szulat and StarGeek, "quality" is not a property that can be removed from a JPEG image.
If your purpose is to remove metadata, you can use any of the following commands:
exiftool -All= image.jpg
jpegoptim -s image.jpg
Some image sharing sites automatically remove metadata.