# HG changeset patch # User sh@sh-laptop # Date 1222364622 14400 # Node ID 213dd524f96b0c03582032353ea064b0238e85a5 # Parent 9a5ef4f632a3bae248d6e746c74a840b583dc904 Improve documentation for image I/O. diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2008-09-25 Søren Hauberg + + * interpreter/image.txi: Update for imread and imwrite instead of + loadimge and saveimage. + 2008-09-24 Soren Hauberg * interpreter/image.txi: Document imfinfo. diff --git a/doc/interpreter/image.txi b/doc/interpreter/image.txi --- a/doc/interpreter/image.txi +++ b/doc/interpreter/image.txi @@ -26,7 +26,7 @@ and compute the gradient of the smoothed image. @example -I = loadimage ("default.img"); +I = imread ("myimage.jpg"); S = conv2 (I, ones (5, 5) / 25, "same"); [Dx, Dy] = gradient (S); @end example @@ -47,20 +47,22 @@ @section Loading and Saving Images The first step in most image processing tasks is to load an image -into Octave. Currently Octave only support saving images in the -Portable Pixmap Format (PPM), PostScript, and Octave's own format, and -loading images in Octave's format. Most image processing code will -follow the structure of this code +into Octave. This is done using the @code{imread} function, which uses the +@code{GraphicsMagick} library for reading. This means a vast number of image +formats is supported. The @code{imwrite} function is the corresponding function +for writing images to the disk. + +In summary, most image processing code will follow the structure of this code @example -I = loadimage ("my_input_image.img"); +I = imread ("my_input_image.img"); J = process_my_image (I); -saveimage ("my_output_image.img", J); +imwrite ("my_output_image.img", J); @end example -@DOCSTRING(loadimage) +@DOCSTRING(imread) -@DOCSTRING(saveimage) +@DOCSTRING(imwrite) @DOCSTRING(IMAGE_PATH) diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-09-25 Søren Hauberg + + * image/imread.m, image/imwrite.m: Doc fix. + 2008-09-24 John W. Eaton * plot/fplot.m: Call axis after calling plot. diff --git a/scripts/image/imread.m b/scripts/image/imread.m --- a/scripts/image/imread.m +++ b/scripts/image/imread.m @@ -31,6 +31,8 @@ ## The colour depth of the image determines the numeric ## class of the output: "uint8" or "uint16" for grey ## and colour, and "logical" for black and white. +## +## @seealso{imwrite, imfinfo} ## @end deftypefn function varargout = imread (filename, varargin) diff --git a/scripts/image/imwrite.m b/scripts/image/imwrite.m --- a/scripts/image/imwrite.m +++ b/scripts/image/imwrite.m @@ -24,7 +24,17 @@ ## If @var{fmt} is missing, the file extension (if any) of ## @var{filename} is used to determine the format. ## -## The parameter-value pairs (@var{p1}, @var{v1}, @dots{}) are optional. +## The parameter-value pairs (@var{p1}, @var{v1}, @dots{}) are optional. Currently +## the following options are supported for @t{JPEG} images +## +## @table @samp +## @item Quality +## Sets the quality of the compression. The corresponding value should be an +## integer between 0 and 100, with larger values meaning higher visual quality +## and less compression. +## @end table +## +## @seealso{imread, imfinfo} ## @end deftypefn function imwrite (varargin)