Comments (4)
Best that I can see from identify and from exiftool, no quality value was recorded in the file. It may have been compressed at quality 50% but it was not recorded. So IM will assume its default quality of 92.
Someone else can double check my assessment.
from imagemagick6.
@fmw42 You're probably right, but IM's current behavior makes it impossible to distinguish between JPEGs that were actually compressed at 92% quality, and JPEGs for which the quality is unknown, which isn't very helpful. Reporting some NaN value or even an empty string (I don't know if there are any IM conventions for this?) would be much more helpful. Knowing that IM cannot establish the quality is actually useful information, whereas getting some arbitrary value that's indistinguishable from a meaningful estimate isn't!
BTW you mention the absence of quality level info in the metadata. I noticed that as well. From the Fotoforensics explainer (tab "Estimating Quality) I understand it's quite rare for JPEGs to have this info in the metadata, and even if it's there, it's often unreliable. It's not entirely clear to me how IM establishes the quality; I suspect somewhere under the hood IM or some delegate library uses either the "Approximate Ratios" or "Approximate Quantization Tables" methods that are mentioned in the Fotoforensics piece. But from the code I can't quite figure out if this is indeed the case.
However, JPEGs created inside IM don't appear to contain quality-related metadata either. Nevertheless, "identify" is able to establish the quality!
A quick example. First I create a new JPEG with 40% compression quality:
convert -quality 40 wizard: wizard-40.jpg
The output of the following ExifTool command doesn't contain anything related to the quality level:
exiftool -X wizard-40.jpg
Despite this, using "identify":
identify -format '%Q\n' wizard-40.jpg
Result:
40
This is all slightly straying from the issue, which is really about the reporting. But since it popped up in the conversation, and I'd be doing some tests with that already, I might as well mention it in case it's of any use.
from imagemagick6.
If you define a quality and add it to the file properly then it will be in the meta data. Most of the JPGs that I have checked have a quality value. If no quality value is in the file, then you get 92. If you have a quality value in the file, then it could have 92, but it will show as a quality value in the file as opposed to no quality value.
An IM developer might comment further on this.
from imagemagick6.
A bit of further digging seems to confirm that IM actually determines the JPEG compression quality from the quantization tables, and not from some pre-defined metadata field:
Line 925 in bf9bc7f
from imagemagick6.
Related Issues (20)
- we don't have the tag 6.9.12-91 in github repo HOT 1
- Missing Backport the ClosestColor improvement from 7.1.0-58 to ImageMagick-6. HOT 1
- Conversion errors for some .tif files with versions higher than 6.9.12-77 HOT 2
- Feature removal: display and/or file associations HOT 1
- Vertical banding with default JPEG DCT method HOT 3
- ImageMagick incorrect crops gif file HOT 2
- Emergency stop of ImageMagick after minimizing and maximizing display window HOT 6
- Unexpected result when chop different type of images HOT 1
- File saved in RAW format has JPEG data HOT 1
- convert monochrome tiff to pdf produces invalid pdf HOT 2
- Problems when convert PDF to png some characteres are converted on black boxes
- librsvg delegate is available but not used HOT 2
- Cannot build with OpenCL HOT 3
- delegates.xml broken for dng:decode HOT 3
- Assertion _cairo_status_is_error (status) failed. HOT 2
- Fail to build: test fail timeout HOT 5
- `SetMagickSecurityPolicy` always fails HOT 6
- `time` security policy is incompatible with long-running processes HOT 1
- regression when comparing images with alpha to image without alpha with -alpha off HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagemagick6.