MIFF format for grayscale images?
Posted: 2011-08-31T17:25:30-07:00
The MIFF documentation does not say how grayscale images are formatted, but IM can successfully write and read them. By experimentation, I see that, for various color types, the samples in a scanline have the following arrangements:
(This would be for an image 8 pixels wide.)
That is, for grayscale images, each scanline is padded with "0" samples to make it use as much space as it would if it were a color image.
Padding with 0s seems odd to me, so I'm wondering if this is by design, or what.
To test this, I'm using commands similar to the following, with IM 6.7.2-1.
Code: Select all
RGB: RGBRGBRGBRGBRGBRGBRGBRGB
Gray: gggggggg0000000000000000
RGBA: RGBARGBARGBARGBARGBARGBARGBARGBA
GrayA: gAgAgAgAgAgAgAgA0000000000000000
That is, for grayscale images, each scanline is padded with "0" samples to make it use as much space as it would if it were a color image.
Padding with 0s seems odd to me, so I'm wondering if this is by design, or what.
To test this, I'm using commands similar to the following, with IM 6.7.2-1.
Code: Select all
convert logo: -type TrueColor -resize 8x8! -depth 8 -compress none -strip rgb.miff
convert logo: -type Grayscale -resize 8x8! -depth 8 -compress none -strip gray.miff
convert logo: -type TrueColorMatte -resize 8x8! -depth 8 -compress none -strip rgba.miff
convert logo: -type GrayscaleMatte -resize 8x8! -depth 8 -compress none -strip graya.miff