Page 1 of 1

keep 8-bit depth grayscale colorspace for output BMP

Posted: 2007-12-30T19:54:52-07:00
by a1s2d3f4
I just started using imagemagick.

With command-line "convert" utility, I am trying to append two images together and have the output file be in the same format as the input images.

My two input images are grayscale (8-bit) BMP images.
(They are 320x480 pixels each, so that's exactly the number of bytes that is contained in the data).

If I do
convert <first_image> <second_image> -color 256 <output_file>, I get an image that's somehow only 144KB (instead of the expected 302KB), while the image properties (in windows) state that it is a "32-bit" image.

If I use identify for my input images I get:
...1.bmp BMP 320x480 320x480+0+0 PseudoClass 256c 8-bit 151.053kb

I don't know what is "PseudoClass", but how do I get my output image to be that type as well?

Thanks,
a1

Re: keep 8-bit depth grayscale colorspace for output BMP

Posted: 2008-01-02T19:29:44-07:00
by fmw42
try

convert <first_image> <second_image> -colorspace Gray <output_file>

Re: keep 8-bit depth grayscale colorspace for output BMP

Posted: 2008-01-04T23:45:58-07:00
by a1s2d3f4
I have tried it. -colorspace Gray option doesn't seem to change anything for me. The output bmp is 24bit.

Re: keep 8-bit depth grayscale colorspace for output BMP

Posted: 2008-01-06T19:50:21-07:00
by fmw42
Do each image separately,

convert image1 -colorspace Gray outimage1
confert image2 -colorspace Gray outimage2

Re: keep 8-bit depth grayscale colorspace for output BMP

Posted: 2008-01-08T15:24:12-07:00
by a1s2d3f4
Converting like you said, creates output images that are smaller in byte size (i.e. from 152KB down to 89KB).
What amazes me, however, is that the quality of the image doesn't degrade.

As I said, my images are 320x480 (=153600bytes), with 8bits of resolution for each pixel. Now, somehow it is almost 1/2 that size, and yet the image quality is still, seemingly at 8 bits. What is going on?

Re: keep 8-bit depth grayscale colorspace for output BMP

Posted: 2008-01-15T10:25:52-07:00
by a1s2d3f4
Does anyone know (re: question in my reply above)?