White images with 'imshow'

John W. Eaton jwe at octave.org
Tue May 26 15:54:12 CDT 2009


On 26-May-2009, Søren Hauberg wrote:

| tir, 26 05 2009 kl. 16:13 -0400, skrev John W. Eaton:
| > On 26-May-2009, Søren Hauberg wrote:
| > 
| > | 2) I think it's true that very few (if any) are actively using the
| > |    Octave image format. So, perhaps we should convert the default image
| > |    ("default.img") into a png image?
| > 
| > It would be fine with me.  I tried
| > 
| >   [im, map] = imread ("default.img");
| >   imwrite (im, map, "default.png")
| > 
| > but it failed with
| > 
| > error: Magick++ exception: Magick: Color argument is invalid reported by Exception.cpp:272 (throwExceptionExplicit)
| > error: called from:
| > error:   /home/jwe/src/octave/scripts/image/imwrite.m at line 148, column 7
| > 
| > What's the right way to do the conversion?  Is there something wrong
| > with the way IM and MAP are returned from imread?  They work with
| > imshow now, so I don't know why imwrite should fail to accept them as
| > well.
| 
| I just tried this, and 'im' is not a valid indexed image. It contains
| double's between 0 and 1, while an indexed image should contain integers
| corresponding to the rows of 'map'.

So why does it work with imshow now?

Also, before I put in the scaling change, it was an indexed image
containing integers (although represented as doubles) corresponding to
the rows of the colormap and imshow could not display it.

So I guess I don't know what I'm doing here and could use some help.

jwe



More information about the Bug-octave mailing list