I could be wrong but I don't think IM PNG supports depth 4 per se. I suspect you need to specify -colors 16 or use -define png:color-type={type}. But please note that IM PNG has undergone quite extensive changes and improvements over time and you would be best to upgrade to the latest release. You can see all the changes from the changelog at
http://www.imagemagick.org/script/changelog.php. Also please review the limitations and parameters for controlling PNG at
http://www.imagemagick.org/Usage/formats/#png_formats and
http://www.imagemagick.org/Usage/formats/#png_write
Your command
convert -size 300x300 xc:white -draw 'line 0,0,300,300' -type Grayscale -depth 4 line4.png
works perfectly fine to make an image like the others on my IM 6.6.9.4 Q16 Mac OSX Tiger.
the verbose statistics are:
Code: Select all
Image: line4.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 300x300+0+0
Resolution: 72x72
Print size: 4.16667x4.16667
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: Gray
Depth: 8/4-bit
Channel depth:
gray: 4-bit
Channel statistics:
Gray:
min: 0 (0)
max: 255 (1)
mean: 254.037 (0.996224)
standard deviation: 14.7561 (0.0578671)
kurtosis: 289.814
skewness: -17.0163
Histogram:
300: ( 0, 0, 0) #000000 black
598: (238,238,238) #EEEEEE gray(238,238,238)
89102: (255,255,255) #FFFFFF white
Colormap: 16
0: ( 0, 0, 0) #000000 black
1: ( 17, 17, 17) #111111 gray(17,17,17)
2: ( 34, 34, 34) #222222 gray(34,34,34)
3: ( 51, 51, 51) #333333 grey20
4: ( 68, 68, 68) #444444 gray(68,68,68)
5: ( 85, 85, 85) #555555 gray(85,85,85)
6: (102,102,102) #666666 grey40
7: (119,119,119) #777777 gray(119,119,119)
8: (136,136,136) #888888 gray(136,136,136)
9: (153,153,153) #999999 grey60
10: (170,170,170) #AAAAAA gray(170,170,170)
11: (187,187,187) #BBBBBB gray(187,187,187)
12: (204,204,204) #CCCCCC grey80
13: (221,221,221) #DDDDDD gray(221,221,221)
14: (238,238,238) #EEEEEE gray(238,238,238)
15: (255,255,255) #FFFFFF white