possible bug with -threshold and/or histogram?
Posted: 2010-02-25T18:00:53-07:00
IM 6.5.9-10 Q16 Mac OSX Tiger
1) I created an image as follows:
convert -background black -fill white -font Candice -pointsize 36 -kerning 5 +dither label:"ABCDEFGHIJKLMNOPQRSTUVWXYZ" -threshold 50% alphabet.gif
but when I do
identify -verbose alphabet.gif
Class: PseudoClass
Geometry: 975x40+0+0
Resolution: 72x72
Print size: 13.5417x0.555556
Units: Undefined
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: RGB
Depth: 8/1-bit
Channel depth:
gray: 1-bit
Channel statistics:
Gray:
min: 0 (0)
max: 65279 (1)
Histogram:
25151: ( 0, 0, 0) #000000 black
13849: (255,255,255) #FFFFFF white
Why am I not getting max of 65535 (since I included -threshold 50%)?
2) I then took that image and coded each letter with an graylevel starting at 1 and increasing by 1 for each character.
This looks totally black, but looking at the histogram, I see each graylevel
identify -verbose alphabet_m1.gif
Format: GIF (CompuServe graphics interchange format)
Class: PseudoClass
Geometry: 975x40+0+0
Resolution: 72x72
Print size: 13.5417x0.555556
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
gray: 8-bit
Channel statistics:
Gray:
min: 0 (0)
max: 13338 (0.101961)
mean: 4.67 (0.0183137)
standard deviation: 7.68574 (0.0301402)
kurtosis: 0.606938
skewness: 1.43078
Histogram:
25151: ( 0, 0, 0) #000000 black
599: ( 1, 1, 1) #010101 rgb(1,1,1)
544: ( 2, 2, 2) #020202 rgb(2,2,2)
585: ( 3, 3, 3) #030303 grey1
565: ( 4, 4, 4) #040404 rgb(4,4,4)
429: ( 5, 5, 5) #050505 grey2
599: ( 6, 6, 6) #060606 rgb(6,6,6)
590: ( 7, 7, 7) #070707 rgb(7,7,7)
450: ( 8, 8, 8 ) #080808 grey3
545: ( 9, 9, 9) #090909 rgb(9,9,9)
577: ( 10, 10, 10) #0A0A0A grey4
648: ( 11, 11, 11) #0B0B0B rgb(11,11,11)
558: ( 12, 12, 12) #0C0C0C rgb(12,12,12)
485: ( 13, 13, 13) #0D0D0D grey5
541: ( 14, 14, 14) #0E0E0E rgb(14,14,14)
547: ( 15, 15, 15) #0F0F0F grey6
536: ( 16, 16, 16) #101010 rgb(16,16,16)
525: ( 17, 17, 17) #111111 rgb(17,17,17)
430: ( 18, 18, 18) #121212 grey7
481: ( 19, 19, 19) #131313 rgb(19,19,19)
620: ( 20, 20, 20) #141414 grey8
595: ( 21, 21, 21) #151515 rgb(21,21,21)
558: ( 22, 22, 22) #161616 rgb(22,22,22)
568: ( 23, 23, 23) #171717 grey9
495: ( 24, 24, 24) #181818 rgb(24,24,24)
373: ( 25, 25, 25) #191919 rgb(25,25,25)
406: ( 26, 26, 26) #1A1A1A grey10
It is strange, but I thought the raw values would be in the range of 0-65535 and not 0-26? Am I misunderstanding the histogram?
Can someone please clarify these 2 questions.
Thanks
Fred
1) I created an image as follows:
convert -background black -fill white -font Candice -pointsize 36 -kerning 5 +dither label:"ABCDEFGHIJKLMNOPQRSTUVWXYZ" -threshold 50% alphabet.gif
but when I do
identify -verbose alphabet.gif
Class: PseudoClass
Geometry: 975x40+0+0
Resolution: 72x72
Print size: 13.5417x0.555556
Units: Undefined
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: RGB
Depth: 8/1-bit
Channel depth:
gray: 1-bit
Channel statistics:
Gray:
min: 0 (0)
max: 65279 (1)
Histogram:
25151: ( 0, 0, 0) #000000 black
13849: (255,255,255) #FFFFFF white
Why am I not getting max of 65535 (since I included -threshold 50%)?
2) I then took that image and coded each letter with an graylevel starting at 1 and increasing by 1 for each character.
This looks totally black, but looking at the histogram, I see each graylevel
identify -verbose alphabet_m1.gif
Format: GIF (CompuServe graphics interchange format)
Class: PseudoClass
Geometry: 975x40+0+0
Resolution: 72x72
Print size: 13.5417x0.555556
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
gray: 8-bit
Channel statistics:
Gray:
min: 0 (0)
max: 13338 (0.101961)
mean: 4.67 (0.0183137)
standard deviation: 7.68574 (0.0301402)
kurtosis: 0.606938
skewness: 1.43078
Histogram:
25151: ( 0, 0, 0) #000000 black
599: ( 1, 1, 1) #010101 rgb(1,1,1)
544: ( 2, 2, 2) #020202 rgb(2,2,2)
585: ( 3, 3, 3) #030303 grey1
565: ( 4, 4, 4) #040404 rgb(4,4,4)
429: ( 5, 5, 5) #050505 grey2
599: ( 6, 6, 6) #060606 rgb(6,6,6)
590: ( 7, 7, 7) #070707 rgb(7,7,7)
450: ( 8, 8, 8 ) #080808 grey3
545: ( 9, 9, 9) #090909 rgb(9,9,9)
577: ( 10, 10, 10) #0A0A0A grey4
648: ( 11, 11, 11) #0B0B0B rgb(11,11,11)
558: ( 12, 12, 12) #0C0C0C rgb(12,12,12)
485: ( 13, 13, 13) #0D0D0D grey5
541: ( 14, 14, 14) #0E0E0E rgb(14,14,14)
547: ( 15, 15, 15) #0F0F0F grey6
536: ( 16, 16, 16) #101010 rgb(16,16,16)
525: ( 17, 17, 17) #111111 rgb(17,17,17)
430: ( 18, 18, 18) #121212 grey7
481: ( 19, 19, 19) #131313 rgb(19,19,19)
620: ( 20, 20, 20) #141414 grey8
595: ( 21, 21, 21) #151515 rgb(21,21,21)
558: ( 22, 22, 22) #161616 rgb(22,22,22)
568: ( 23, 23, 23) #171717 grey9
495: ( 24, 24, 24) #181818 rgb(24,24,24)
373: ( 25, 25, 25) #191919 rgb(25,25,25)
406: ( 26, 26, 26) #1A1A1A grey10
It is strange, but I thought the raw values would be in the range of 0-65535 and not 0-26? Am I misunderstanding the histogram?
Can someone please clarify these 2 questions.
Thanks
Fred