What does return the %[mean] option?
Posted: 2010-11-02T01:57:13-07:00
Hello to everyone,
after searching the whole web and esp. this forum up and down for several days I find no other chance to post a new question here. Sorry to bother you.
Ok, this is the task: I do have tiff images in CMYK format 32bit color depth. What I do need is the information, how much of the pixels are cyan, magenta and yellow. A percentage value is my my first choice.
After reading the IM doc and lots of topics here in the forum and all over the web, it looks as if the following command line would return me exactly what I'm looking for:
It seems as if this command does return a percentage value of the all cyan pixels related to the total amount of all pixels in the given tiff file. Is this correct? Or what else does the %[mean] option (do you call it option? Or what is it called in terms of IM?) return when I use it? I have learned, that it returns a "mean value", but what does it mean, this "mean value"?
Btw.: perhaps someone can tell me a better way how to solve my task. Again, this is what I need: Let's say there is a tiff image with 300*300 pixels, where 500 of these pixels do have a cyan color part (no matter, how intense the cyan part is, only it is not 0). So I'd need a result, telling me, that the tiff does contain a cyan percentage of 100*500/(300*300) = 0.556%. And if the image does contain 10000 pixels with magenta, so I'd get a result of 100*10000/(300*300) = 11.1%. Thats all I need.
after searching the whole web and esp. this forum up and down for several days I find no other chance to post a new question here. Sorry to bother you.
Ok, this is the task: I do have tiff images in CMYK format 32bit color depth. What I do need is the information, how much of the pixels are cyan, magenta and yellow. A percentage value is my my first choice.
After reading the IM doc and lots of topics here in the forum and all over the web, it looks as if the following command line would return me exactly what I'm looking for:
Code: Select all
identify -format "%[fx:mean.c]" image.tif
Btw.: perhaps someone can tell me a better way how to solve my task. Again, this is what I need: Let's say there is a tiff image with 300*300 pixels, where 500 of these pixels do have a cyan color part (no matter, how intense the cyan part is, only it is not 0). So I'd need a result, telling me, that the tiff does contain a cyan percentage of 100*500/(300*300) = 0.556%. And if the image does contain 10000 pixels with magenta, so I'd get a result of 100*10000/(300*300) = 11.1%. Thats all I need.