changeset 8148:213dd524f96b

Improve documentation for image I/O.
author sh@sh-laptop
date Thu, 25 Sep 2008 13:43:42 -0400
parents 9a5ef4f632a3
children a8fb37ae61b8
files doc/ChangeLog doc/interpreter/image.txi scripts/ChangeLog scripts/image/imread.m scripts/image/imwrite.m
diffstat 5 files changed, 33 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Thu Sep 25 13:03:17 2008 -0400
+++ b/doc/ChangeLog	Thu Sep 25 13:43:42 2008 -0400
@@ -1,3 +1,8 @@
+2008-09-25  Søren Hauberg  <hauberg@gmail.com>
+
+	* interpreter/image.txi: Update for imread and imwrite instead of
+	loadimge and saveimage.
+
 2008-09-24  Soren Hauberg  <hauberg@gmail.com>
 
 	* interpreter/image.txi: Document imfinfo.
--- a/doc/interpreter/image.txi	Thu Sep 25 13:03:17 2008 -0400
+++ b/doc/interpreter/image.txi	Thu Sep 25 13:43:42 2008 -0400
@@ -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)
 
--- a/scripts/ChangeLog	Thu Sep 25 13:03:17 2008 -0400
+++ b/scripts/ChangeLog	Thu Sep 25 13:43:42 2008 -0400
@@ -1,3 +1,7 @@
+2008-09-25  Søren Hauberg  <hauberg@gmail.com>
+
+	* image/imread.m, image/imwrite.m: Doc fix.
+
 2008-09-24  John W. Eaton  <jwe@octave.org>
 
 	* plot/fplot.m: Call axis after calling plot.
--- a/scripts/image/imread.m	Thu Sep 25 13:03:17 2008 -0400
+++ b/scripts/image/imread.m	Thu Sep 25 13:43:42 2008 -0400
@@ -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)
--- a/scripts/image/imwrite.m	Thu Sep 25 13:03:17 2008 -0400
+++ b/scripts/image/imwrite.m	Thu Sep 25 13:43:42 2008 -0400
@@ -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)