"-define unique=true" doesn't work?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Rolen47

"-define unique=true" doesn't work?

Post by Rolen47 »

I'm really confused. I want imageMagick to tell me how many unique colors there are in my PNG, so I read on the website that I'm supposed to type

Code: Select all

$magick> identify -define unique=true -verbose image.png
But that doesn't seem to tell me how many unique colors are in the image...

Code: Select all

C:\Program Files\ImageMagick-6.5.9-Q16>identify -define unique=true -verbose scr
eenshot.png
Image: screenshot.png
  Format: PNG (Portable Network Graphics)
  Class: DirectClass
  Geometry: 256x224+0+0
  Resolution: 37.79x37.79
  Print size: 6.77427890976449x5.92749404604393
  Units: PixelsPerCentimeter
  Type: Palette
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    red:
      min: 0 (0)
      max: 255 (1)
      mean: 75.7086530412946 (0.296896678593312)
      standard deviation: 59.0600926419051 (0.231608206438844)
      kurtosis: 2.52114238626676
      skewness: 1.88974056563478
    green:
      min: 0 (0)
      max: 255 (1)
      mean: 61.8081577845982 (0.24238493248862)
      standard deviation: 55.2801961484656 (0.216785082935159)
      kurtosis: 4.62022539538659
      skewness: 2.3459182659207
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 50.4521658761161 (0.19785163088673)
      standard deviation: 56.8206417026747 (0.222826045892842)
      kurtosis: 5.32489954806508
      skewness: 2.49890116273284
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 46.9922441755022 (0.184283310492166)
      standard deviation: 57.0897658464959 (0.223881434692141)
      kurtosis: 4.69065584980337
      skewness: 2.1995310311557
  Histogram:
       401: (  0,  0,  0) #000000 black
      3840: ( 29, 23, 16) #1D1710 rgb(29,23,16)
      1344: ( 31, 36, 44) #1F242C rgb(31,36,44)
      9830: ( 36, 30, 17) #241E11 rgb(36,30,17)
       835: ( 36, 30, 23) #241E17 rgb(36,30,23)
       144: ( 40, 32, 48) #282030 rgb(40,32,48)
       127: ( 40, 32, 56) #282038 rgb(40,32,56)
      1628: ( 43, 37, 23) #2B2517 rgb(43,37,23)
      1023: ( 43, 37, 30) #2B251E rgb(43,37,30)
       324: ( 44, 51, 37) #2C3325 rgb(44,51,37)
        66: ( 48, 64,104) #304068 rgb(48,64,104)
      7326: ( 50, 37, 30) #32251E rgb(50,37,30)
        93: ( 50, 44, 44) #322C2C rgb(50,44,44)
       843: ( 51, 51, 44) #33332C rgb(51,51,44)
       410: ( 56, 24, 48) #381830 rgb(56,24,48)
       270: ( 56, 40, 80) #382850 rgb(56,40,80)
       289: ( 56, 48, 72) #383048 rgb(56,48,72)
      9436: ( 64, 51, 30) #40331E rgb(64,51,30)
      6272: ( 71, 51, 37) #473325 rgb(71,51,37)
        25: ( 73, 73, 73) #494949 rgb(73,73,73)
      1917: ( 79, 66, 44) #4F422C rgb(79,66,44)
       186: ( 80, 56, 64) #503840 rgb(80,56,64)
       153: ( 88, 64, 48) #584030 rgb(88,64,48)
        98: ( 96, 72,112) #604870 rgb(96,72,112)
       215: (104, 48, 48) #683030 rgb(104,48,48)
       283: (104, 56, 24) #683818 rgb(104,56,24)
       145: (104, 72, 48) #684830 rgb(104,72,48)
       177: (104, 88, 88) #685858 rgb(104,88,88)
      1039: (111,111,111) #6F6F6F rgb(111,111,111)
         7: (115, 81, 33) #735121 rgb(115,81,33)
        19: (118,128, 40) #768028 rgb(118,128,40)
       129: (120, 16, 24) #781018 rgb(120,16,24)
        17: (120,152,192) #7898C0 rgb(120,152,192)
       128: (128, 88, 48) #805830 rgb(128,88,48)
        21: (128,120,152) #807898 rgb(128,120,152)
       474: (135,142,142) #878E8E rgb(135,142,142)
       114: (136, 96,112) #886070 rgb(136,96,112)
       265: (144, 96, 48) #906030 rgb(144,96,48)
        27: (144, 96, 96) #906060 rgb(144,96,96)
       619: (150,150,150) #969696 grey59
        45: (151,158,166) #979EA6 rgb(151,158,166)
       230: (152, 80, 56) #985038 rgb(152,80,56)
        16: (152,144,144) #989090 rgb(152,144,144)
       135: (160,112, 80) #A07050 rgb(160,112,80)
       129: (168,104, 72) #A86848 rgb(168,104,72)
        23: (172,158,150) #AC9E96 rgb(172,158,150)
        49: (174,174,166) #AEAEA6 rgb(174,174,166)
       210: (176, 72, 56) #B04838 rgb(176,72,56)
       134: (184,136, 72) #B88848 rgb(184,136,72)
       194: (184,152, 88) #B89858 rgb(184,152,88)
        83: (184,160,128) #B8A080 rgb(184,160,128)
        29: (188,174,151) #BCAE97 rgb(188,174,151)
       169: (192,112, 96) #C07060 rgb(192,112,96)
       114: (192,119, 38) #C07726 rgb(192,119,38)
       116: (192,160,160) #C0A0A0 rgb(192,160,160)
        37: (196,174,159) #C4AE9F rgb(196,174,159)
        57: (200, 48, 72) #C83048 rgb(200,48,72)
        15: (204,191,167) #CCBFA7 rgb(204,191,167)
       606: (206,206,206) #CECECE rgb(206,206,206)
       155: (208,168,112) #D0A870 rgb(208,168,112)
       119: (216,112, 80) #D87050 rgb(216,112,80)
       133: (216,144,112) #D89070 rgb(216,144,112)
       136: (224,144,112) #E09070 rgb(224,144,112)
       108: (224,176,152) #E0B098 rgb(224,176,152)
       156: (224,200,208) #E0C8D0 rgb(224,200,208)
       152: (232,216,152) #E8D898 rgb(232,216,152)
       333: (240, 32, 40) #F02028 rgb(240,32,40)
       146: (240,184,152) #F0B898 rgb(240,184,152)
        77: (240,205,192) #F0CDC0 rgb(240,205,192)
       144: (240,224,200) #F0E0C8 rgb(240,224,200)
      2364: (247,247,247) #F7F7F7 grey97
         7: (248,240,240) #F8F0F0 rgb(248,240,240)
       364: (255,255,255) #FFFFFF white
  Rendering intent: Saturation
  Gamma: 0.454549998044968
  Chromaticity:
    red primary: (0.639999985694885,0.330000013113022)
    green primary: (0.300000011920929,0.600000023841858)
    blue primary: (0.150000005960464,0.0599999986588955)
    white point: (0.312700003385544,0.328999996185303)
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x224+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2010-01-30T11:15:44-07:00
    date:modify: 2009-11-17T12:47:50-07:00
    signature: 6c273d5e366ef05ccf93ef2c3763834e16e25953c09cccf440b8fe914933664b
  Artifacts:
    unique: true
    verbose: true
  Tainted: False
  Filesize: 25.9KB
  Number pixels: 57.3KB
  Pixels per second: 3.823MB
  User time: 0.016u
  Elapsed time: 0:01.015
  Version: ImageMagick 6.5.9-0 2010-01-11 Q16 http://www.imagemagick.org

C:\Program Files\ImageMagick-6.5.9-Q16>pause
Press any key to continue . . .
What am I doing wrong? Irfanview tells me there's 73 unique colors in my image. Why can't I get imageMagick tell me that?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "-define unique=true" doesn't work?

Post by magick »

Try -define identify:unique=true. We'll fix the documentation.
Rolen47

Re: "-define unique=true" doesn't work?

Post by Rolen47 »

Thanks, that worked great.
Post Reply