Page 1 of 1

Finding channel mean Value

Posted: 2012-05-09T13:23:41-07:00
by robuntu
Hi,
I need to know which channel (c,m,y,k) is used less in an cmyk Image.
If I use

Code: Select all

identify -verbose pic.tif

I get the information, but is there a way to get only this value
for automatic controlling with something like

Code: Select all

identify -format %[mean usage of channel "c"]
or listed with all channels?

Great would be an output like:
c : 23%
m: 40%
y: 60%
k: 20%

Any Ideas?
Thanks for your help
Roland

Re: Finding channel mean Value

Posted: 2012-05-09T13:40:40-07:00
by fmw42
try as I said in your other post using .c or .y or .m or .k in the fx expression.

create cmyk image:
convert rose: -colorspace cmyk rose_cmyk.jpg

Then
convert rose_cmyk.jpg -format "%[fx:mean.c]" info:
or
identify -format "%[fx:mean.c]" rose_cmyk.jpg
0.0463268