
I looked everywhere, but couldn't find out what command line command I have to enter to let ImageMagick count the unique colors in an image and write the result to the command line ...
Any ideas? Thanks so much!!
Code: Select all
identify -format %k filename
boarders' paradise wrote:Hi. Sorry, I'm a beginner ...![]()
I looked everywhere, but couldn't find out what command line command I have to enter to let ImageMagick count the unique colors in an image and write the result to the command line ...
Any ideas? Thanks so much!!
Code: Select all
input: identify -unique-colors sunset.png
output: 13889
Code: Select all
c:\SOURCE.png ^
-set colorspace sRGB -alpha extract ^
c:\ALPHA-channel-of-PNG.miff
identify -format "%k" c:\ALPHA-channel-of-PNG.miff
Code: Select all
convert ^
c:\SOURCE.png ^
-set colorspace sRGB -alpha extract ^
-identify -format "%k" info:
Code: Select all
c:\SOURCE.png PNG 300x300 300x300+0+0 8-bit sRGB 24198B 0.016u 0:00.014
243
Code: Select all
convert SOURCE.png -alpha extract -scale 1x1! -format "%[fx:mean]" info:
Code: Select all
convert SOURCE.png -alpha extract -scale 1x1! -format "%[fx:mean<1?1:0]" info:
Code: Select all
convert: unknown image property "%[colors]" @ warning/property.c/InterpretImageP
roperties/3934.
Code: Select all
f:\web\im>%IM%convert toes.png -format %[opaque] info:
true
f:\web\im>%IM%convert toes_holed.png -format %[opaque] info:
false