I see, the problem is that I have little knowledge in image processing and ImageMagick, but I can easily code in Ruby. For example for this image (after converting to gray colorspace) I get the following histogram:
Code: Select all
Histogram:
1: ( 1, 1, 1) #010101 gray(1)
18: ( 2, 2, 2) #020202 gray(2)
88: ( 3, 3, 3) #030303 gray(3)
284: ( 4, 4, 4) #040404 gray(4)
559: ( 5, 5, 5) #050505 gray(5)
1203: ( 6, 6, 6) #060606 gray(6)
1549: ( 7, 7, 7) #070707 gray(7)
2151: ( 8, 8, 8) #080808 gray(8)
3049: ( 9, 9, 9) #090909 gray(9)
3791: ( 10, 10, 10) #0A0A0A gray(10)
3817: ( 11, 11, 11) #0B0B0B gray(11)
4073: ( 12, 12, 12) #0C0C0C gray(12)
3930: ( 13, 13, 13) #0D0D0D gray(13)
3572: ( 14, 14, 14) #0E0E0E gray(14)
3078: ( 15, 15, 15) #0F0F0F gray(15)
2763: ( 16, 16, 16) #101010 gray(16)
2309: ( 17, 17, 17) #111111 gray(17)
1993: ( 18, 18, 18) #121212 gray(18)
1775: ( 19, 19, 19) #131313 gray(19)
1755: ( 20, 20, 20) #141414 gray(20)
1566: ( 21, 21, 21) #151515 gray(21)
1478: ( 22, 22, 22) #161616 gray(22)
1421: ( 23, 23, 23) #171717 gray(23)
1388: ( 24, 24, 24) #181818 gray(24)
1399: ( 25, 25, 25) #191919 gray(25)
1326: ( 26, 26, 26) #1A1A1A gray(26)
1300: ( 27, 27, 27) #1B1B1B gray(27)
1365: ( 28, 28, 28) #1C1C1C gray(28)
1201: ( 29, 29, 29) #1D1D1D gray(29)
1139: ( 30, 30, 30) #1E1E1E gray(30)
1135: ( 31, 31, 31) #1F1F1F gray(31)
929: ( 32, 32, 32) #202020 gray(32)
866: ( 33, 33, 33) #212121 gray(33)
748: ( 34, 34, 34) #222222 gray(34)
710: ( 35, 35, 35) #232323 gray(35)
698: ( 36, 36, 36) #242424 gray(36)
656: ( 37, 37, 37) #252525 gray(37)
664: ( 38, 38, 38) #262626 gray(38)
638: ( 39, 39, 39) #272727 gray(39)
635: ( 40, 40, 40) #282828 gray(40)
645: ( 41, 41, 41) #292929 gray(41)
666: ( 42, 42, 42) #2A2A2A gray(42)
678: ( 43, 43, 43) #2B2B2B gray(43)
658: ( 44, 44, 44) #2C2C2C gray(44)
658: ( 45, 45, 45) #2D2D2D gray(45)
658: ( 46, 46, 46) #2E2E2E gray(46)
638: ( 47, 47, 47) #2F2F2F gray(47)
685: ( 48, 48, 48) #303030 gray(48)
669: ( 49, 49, 49) #313131 gray(49)
670: ( 50, 50, 50) #323232 gray(50)
737: ( 51, 51, 51) #333333 gray(51)
685: ( 52, 52, 52) #343434 gray(52)
745: ( 53, 53, 53) #353535 gray(53)
665: ( 54, 54, 54) #363636 gray(54)
718: ( 55, 55, 55) #373737 gray(55)
766: ( 56, 56, 56) #383838 gray(56)
753: ( 57, 57, 57) #393939 gray(57)
764: ( 58, 58, 58) #3A3A3A gray(58)
759: ( 59, 59, 59) #3B3B3B gray(59)
781: ( 60, 60, 60) #3C3C3C gray(60)
825: ( 61, 61, 61) #3D3D3D gray(61)
871: ( 62, 62, 62) #3E3E3E gray(62)
862: ( 63, 63, 63) #3F3F3F gray(63)
865: ( 64, 64, 64) #404040 gray(64)
991: ( 65, 65, 65) #414141 gray(65)
944: ( 66, 66, 66) #424242 gray(66)
1072: ( 67, 67, 67) #434343 gray(67)
1044: ( 68, 68, 68) #444444 gray(68)
1137: ( 69, 69, 69) #454545 gray(69)
1214: ( 70, 70, 70) #464646 gray(70)
1244: ( 71, 71, 71) #474747 gray(71)
1392: ( 72, 72, 72) #484848 gray(72)
1509: ( 73, 73, 73) #494949 gray(73)
1606: ( 74, 74, 74) #4A4A4A gray(74)
1727: ( 75, 75, 75) #4B4B4B gray(75)
1891: ( 76, 76, 76) #4C4C4C gray(76)
1918: ( 77, 77, 77) #4D4D4D gray(77)
2002: ( 78, 78, 78) #4E4E4E gray(78)
2310: ( 79, 79, 79) #4F4F4F gray(79)
2371: ( 80, 80, 80) #505050 gray(80)
2464: ( 81, 81, 81) #515151 gray(81)
2505: ( 82, 82, 82) #525252 gray(82)
2633: ( 83, 83, 83) #535353 gray(83)
2748: ( 84, 84, 84) #545454 gray(84)
3012: ( 85, 85, 85) #555555 gray(85)
3022: ( 86, 86, 86) #565656 gray(86)
3073: ( 87, 87, 87) #575757 gray(87)
2989: ( 88, 88, 88) #585858 gray(88)
2909: ( 89, 89, 89) #595959 gray(89)
3203: ( 90, 90, 90) #5A5A5A gray(90)
3200: ( 91, 91, 91) #5B5B5B gray(91)
3187: ( 92, 92, 92) #5C5C5C gray(92)
3085: ( 93, 93, 93) #5D5D5D gray(93)
2815: ( 94, 94, 94) #5E5E5E gray(94)
2771: ( 95, 95, 95) #5F5F5F gray(95)
2658: ( 96, 96, 96) #606060 gray(96)
2468: ( 97, 97, 97) #616161 gray(97)
2540: ( 98, 98, 98) #626262 gray(98)
2445: ( 99, 99, 99) #636363 gray(99)
2440: (100,100,100) #646464 gray(100)
2370: (101,101,101) #656565 gray(101)
2245: (102,102,102) #666666 gray(102)
2117: (103,103,103) #676767 gray(103)
1952: (104,104,104) #686868 gray(104)
1853: (105,105,105) #696969 gray(105)
1678: (106,106,106) #6A6A6A gray(106)
1527: (107,107,107) #6B6B6B gray(107)
1443: (108,108,108) #6C6C6C gray(108)
1429: (109,109,109) #6D6D6D gray(109)
1417: (110,110,110) #6E6E6E gray(110)
1422: (111,111,111) #6F6F6F gray(111)
1368: (112,112,112) #707070 gray(112)
1245: (113,113,113) #717171 gray(113)
1180: (114,114,114) #727272 gray(114)
1115: (115,115,115) #737373 gray(115)
1011: (116,116,116) #747474 gray(116)
941: (117,117,117) #757575 gray(117)
878: (118,118,118) #767676 gray(118)
819: (119,119,119) #777777 gray(119)
826: (120,120,120) #787878 gray(120)
674: (121,121,121) #797979 gray(121)
671: (122,122,122) #7A7A7A gray(122)
582: (123,123,123) #7B7B7B gray(123)
530: (124,124,124) #7C7C7C gray(124)
494: (125,125,125) #7D7D7D gray(125)
428: (126,126,126) #7E7E7E gray(126)
477: (127,127,127) #7F7F7F gray(127)
463: (128,128,128) #808080 gray(128)
455: (129,129,129) #818181 gray(129)
404: (130,130,130) #828282 gray(130)
391: (131,131,131) #838383 gray(131)
385: (132,132,132) #848484 gray(132)
339: (133,133,133) #858585 gray(133)
359: (134,134,134) #868686 gray(134)
341: (135,135,135) #878787 gray(135)
331: (136,136,136) #888888 gray(136)
310: (137,137,137) #898989 gray(137)
333: (138,138,138) #8A8A8A gray(138)
338: (139,139,139) #8B8B8B gray(139)
333: (140,140,140) #8C8C8C gray(140)
354: (141,141,141) #8D8D8D gray(141)
371: (142,142,142) #8E8E8E gray(142)
353: (143,143,143) #8F8F8F gray(143)
324: (144,144,144) #909090 gray(144)
338: (145,145,145) #919191 gray(145)
322: (146,146,146) #929292 gray(146)
295: (147,147,147) #939393 gray(147)
261: (148,148,148) #949494 gray(148)
229: (149,149,149) #959595 gray(149)
244: (150,150,150) #969696 gray(150)
214: (151,151,151) #979797 gray(151)
175: (152,152,152) #989898 gray(152)
155: (153,153,153) #999999 gray(153)
119: (154,154,154) #9A9A9A gray(154)
88: (155,155,155) #9B9B9B gray(155)
67: (156,156,156) #9C9C9C gray(156)
47: (157,157,157) #9D9D9D gray(157)
25: (158,158,158) #9E9E9E gray(158)
20: (159,159,159) #9F9F9F gray(159)
17: (160,160,160) #A0A0A0 gray(160)
10: (161,161,161) #A1A1A1 gray(161)
9: (162,162,162) #A2A2A2 gray(162)
4: (163,163,163) #A3A3A3 gray(163)
2: (164,164,164) #A4A4A4 gray(164)
1: (165,165,165) #A5A5A5 gray(165)
1: (166,166,166) #A6A6A6 gray(166)
1: (167,167,167) #A7A7A7 gray(167)