[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anybody have a prgram to write a .bmp file?
From: |
Robert A. Macy |
Subject: |
Re: Anybody have a prgram to write a .bmp file? |
Date: |
Sun, 04 Feb 2007 06:14:39 -0800 |
Forgot to mention that on the WinXP machine, where imshow
works, that
>> imshow(r,256);
produces perfect gray scale images.
Somehow it makes two files
1 internet explorer file
2 .bmp file
the .bmp file is stored as 256 color 113K size
and note
the range of r is 0 <= r <= 1
and does NOT have to be reduced at the top end as I have to
do with gray2ind before bmpwrite.
- Robert -
On Sun, 04 Feb 2007 05:44:33 -0800
"Robert A. Macy" <address@hidden> wrote:
> color doesn't seem to work almost at all
>
> if I do
> >> [X,map]=rgb2ind(r,g,b);
> >> saveimage("Xtest.ppm",X,"ppm",map);
> I almost get something of interest
>
> if I do
> >> [X,map]=gray2ind(r,256);
> >> bmpwrite(X,map,"Xtest.bmp");
> I get a proper gray scaled image EXCEPT...
> r cannot be in this range 0 <= r <= 1
> it must be in this range 0 <= r <= 255/256
> or else wherever the image is near 1 becomes black as if
> 0
>
> Using Paint:
> just a note, the Xtest.bmp in gray scale is stored as 256
> color at a size of 113K. If I save the image as 24 bit
> color, the stored file enlarges to 334K.
>
> octave:
> Converting the r,g,b to indexed image and then bmpwrite
> that image is also stored also as 256 color, not 24 bit
> color?! and the size is too large at 556K?! Not the
> proper
> 24 bit color size of 334K. Note .ppm was 334K.
>
> - Robrt-
>
> interestingly, the command
> >> saveimage("Xtest.ppm",X,"ppm",map);
> produces a 334K size file.
>
>