[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: |
Thu, 01 Feb 2007 13:43:55 -0800 |
that's because bmpwrite is expecting THREE arguments, you
only gave it two
On Thu, 01 Feb 2007 12:52:28 -0800
"Henry F. Mollet" <address@hidden> wrote:
> GNU Octave, version 2.1.71 (powerpc-apple-darwin8.1.0).
>
> "cat" works for me (built-in function)
> but I have a different problem:
> octave:7> bmpwrite(cat(3,r,g,b)*256,'Xtest.bmp');
> error: `file' undefined near line 14 column 18
> error: evaluating argument list element number 1
> error: evaluating assignment expression near line 14,
> column 10
> error: called from `bmpwrite' in file
>
`/usr/local/share/octave/2.1.71/site/m/octave-forge/image/bmpwrite.m'
>
> Line 14 in bmpwrite.m is:
> file = fopen(file, "wb");
>
> Henry
>
>
> on 1/31/07 7:44 PM, Robert A. Macy at address@hidden
> wrote:
>
> > 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
> >>
> >
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
>