Image compressibility metric?
-
- Posts: 50
- Joined: 2013-08-07T13:50:31-07:00
- Authentication code: 6789
Image compressibility metric?
How can I get a measurement / metric of the compressibility of an image? I think it is related to the details, texture, and maybe number of colours on an image.
Re: Image compressibility metric?
See entropy from identify -verbose. It may only be available in the latest release, ImageMagick 6.9.0.
-
- Posts: 50
- Joined: 2013-08-07T13:50:31-07:00
- Authentication code: 6789
Re: Image compressibility metric?
Thx, compiling.
Is it possible to calculate only the entropy with the "identify" command? For speed reasons.
Is it possible to calculate only the entropy with the "identify" command? For speed reasons.
Re: Image compressibility metric?
You can get image entropy from the MagickCore API call GetImageEntropy(). From the command-line, entropy is only available with identify -verbose where it computes numerous other image statistics as well.
-
- Posts: 50
- Joined: 2013-08-07T13:50:31-07:00
- Authentication code: 6789
Re: Image compressibility metric?
Sad to hear, I never used an API. Is it possible to use it with Ruby?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image compressibility metric?
see string formats http://www.imagemagick.org/script/escape.php. It list [entropy]. This works for me
0.89247
or
0.89247
Compressability is probably format dependent. JPG has one form of compression, png has another and tiff has several optional forms.
Code: Select all
convert rose: -format "%[entropy]" info:
or
Code: Select all
identify -format "%[entropy]" rose:
Compressability is probably format dependent. JPG has one form of compression, png has another and tiff has several optional forms.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Image compressibility metric?
What does "compressibility" mean? One definition would be "the actual lossless compression that can be achieved". This would be the number of bits in the file, minus the overhead for headers etc, divided by the number of pixels.konstantin wrote:How can I get a measurement / metric of the compressibility of an image? I think it is related to the details, texture, and maybe number of colours on an image.
Then you might consider a lossy compression that doesn't visibly change the image.
snibgo's IM pages: im.snibgo.com
-
- Posts: 50
- Joined: 2013-08-07T13:50:31-07:00
- Authentication code: 6789
Re: Image compressibility metric?
Thx, it works, and quick enough.
-
- Posts: 50
- Joined: 2013-08-07T13:50:31-07:00
- Authentication code: 6789
Re: Image compressibility metric?
In fact I would mean the detailness or "business" of an image, but I assumed in the past that it is in connection with the compressibility, so I used the quality 2 jpeg file size as a metric for the image quality. Now I will try to use the entropy instead of.
snibgo wrote:What does "compressibility" mean? One definition would be "the actual lossless compression that can be achieved". This would be the number of bits in the file, minus the overhead for headers etc, divided by the number of pixels.konstantin wrote:How can I get a measurement / metric of the compressibility of an image? I think it is related to the details, texture, and maybe number of colours on an image.
Then you might consider a lossy compression that doesn't visibly change the image.