# HG changeset patch # User address@hidden # Date 1222341972 -7200 # Node ID 47dbd7d0c96255cf2b694204c057e27be6c9c1af # Parent 4e3cf7f89f7bb8a0f0404cad2b98566f42f38284 Improve documentation for image I/O. diff -r 4e3cf7f89f7b -r 47dbd7d0c962 doc/interpreter/image.txi --- a/doc/interpreter/image.txi Thu Sep 25 08:40:53 2008 +0200 +++ b/doc/interpreter/image.txi Thu Sep 25 13:26:12 2008 +0200 @@ -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 address@hidden 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 address@hidden(loadimage) address@hidden(imread) address@hidden(saveimage) address@hidden(imwrite) @DOCSTRING(IMAGE_PATH) diff -r 4e3cf7f89f7b -r 47dbd7d0c962 scripts/image/imread.m --- a/scripts/image/imread.m Thu Sep 25 08:40:53 2008 +0200 +++ b/scripts/image/imread.m Thu Sep 25 13:26:12 2008 +0200 @@ -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 -r 4e3cf7f89f7b -r 47dbd7d0c962 scripts/image/imwrite.m --- a/scripts/image/imwrite.m Thu Sep 25 08:40:53 2008 +0200 +++ b/scripts/image/imwrite.m Thu Sep 25 13:26:12 2008 +0200 @@ -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)