[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: |
Wed, 31 Jan 2007 19:44:21 -0800 |
Is there another way?
cat comes back as undefined.
On Wed, 31 Jan 2007 21:06:09 -0500
Paul Kienzle <address@hidden> wrote:
>
> On Jan 30, 2007, at 10:01 PM, Robert A. Macy wrote:
>
> > However, it has the same flaw that all the image
> functions
> > are doing:
> >>> r=ones(256,1)*(0:255)/255;
> >>> g=.5*ones(256,256);b=.5*ones(256,256);
> >>> [X,map]=rgb2ind(r,g,b);
> >>> bmpwrite(X,map,"Xtest.bmp");
> > when opened the square is not gradually changing color
> as
> > expected, but a solid green square.
>
> bmpwrite is expecting values in 0-255. Try the
> following:
>
> r=ones(256,1)*(0:255)/255;
> g=.5*ones(256,256);b=.5*ones(256,256);
> bmpwrite(cat(3,r,g,b)*256,'Xtest.bmp');
>
> - Paul
>