[OctDev] Re: imread / imwrite status?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OctDev] Re: imread / imwrite status?

Stéfan van der Walt
On Fri, Sep 09, 2005 at 08:34:26PM -0400, Paul Kienzle wrote:
> Octave-forge has {jpg,png}{read,write}.  imread could check if those
> functions are available and use them for the appropriate files,
> otherwise use imagemagick.

I've submitted changes that implement the above behaviour to
octave-forge CVS.  Please verify that everything still works smoothly.

Colour images should now be returned as MxNx3, with the appropriate
numeric class: logical for black & white, uint8 for grey-level/colour
and double for any other precision.  I reverted back to using
temporary files, because pipes were too slow.  One new "dependency" is
introduced: `identify', also from ImageMagick (installed along with
`convert' on most systems).

Currently, many imaging functions take r, g, and b as parameters --
this would now change to I(:,:,1), I(:,:,2), I(:,:,3).  There is,
however, no consistent interface which states whether images should be
in [0-255] or [0-1] -- using numeric classes addresses this.

Because of a bug in saveimage.m, black and white images may display
incorrectly (white stripes every 8th pixel).  Until that's fixed, a
simple workaround is to simply convert to a double:

x = imread('black_and_white.png');
imshow(double(x))

The next move would be to systematically work through all the imaging
functions and make sure they use the new format.  A good start would
probably be to write `im2gray'.

Regards
Stéfan


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev