comparison scripts/image/imread.m @ 16996:a1d091243d11

Read alpha values from indexed images. Always read indexes from indexed images. * __magick_read__.cc (read_indexed_images): turn function into template to remove duplicated loop. Create alpha channel from alpha values colormap. Skip reading of colormap unless requested. Use fortran_vec to fill the image instead of indexing the Array<T> with a dim_vector which requires multiple calls to dim_vector::operator() per iteration. (__magick_read__): Always read the indexes of an indexed image and not the RGB or grayscale values when no colormap is requested for output (Matlab compatibility). * imread.m: document that an indexed image is always read as such, independently of the colormap having been requested or not. * NEWS: add note on the change for reading indexed images.
author Carnë Draug <carandraug@octave.org>
date Thu, 18 Jul 2013 01:52:09 +0100
parents 997efb8d0b19
children 3db796f89695
comparison
equal deleted inserted replaced
16995:1a1e831fe6b4 16996:a1d091243d11
40 ## of size @nospell{MxN}. Multipage images will have an additional 4th 40 ## of size @nospell{MxN}. Multipage images will have an additional 4th
41 ## dimension. 41 ## dimension.
42 ## The bit depth of the image determines the 42 ## The bit depth of the image determines the
43 ## class of the output: "uint8" or "uint16" for gray 43 ## class of the output: "uint8" or "uint16" for gray
44 ## and color, and "logical" for black and white. 44 ## and color, and "logical" for black and white.
45 ## Note that indexed images always return the indexes for a colormap,
46 ## independent if @var{map} is a requested output. To obtain the actual
47 ## RGB image, use @code{ind2rgb}.
45 ## See the Octave manual for more information in representing images. 48 ## See the Octave manual for more information in representing images.
46 ## 49 ##
47 ## Some file formats, such as TIFF and GIF, are able to store multiple 50 ## Some file formats, such as TIFF and GIF, are able to store multiple
48 ## images in a single file. @var{idx} can be a scalar or vector 51 ## images in a single file. @var{idx} can be a scalar or vector
49 ## specifying the index of the images to read. By default, Octave 52 ## specifying the index of the images to read. By default, Octave
51 ## 54 ##
52 ## Depending on the file format, it is possible to configure the reading 55 ## Depending on the file format, it is possible to configure the reading
53 ## of images with @var{param}, @var{val} pairs. The following options 56 ## of images with @var{param}, @var{val} pairs. The following options
54 ## are supported: 57 ## are supported:
55 ## 58 ##
56 ## @table @asis 59 ## @table @samp
57 ## @item Frames or Index 60 ## @item "Frames" or "Index"
58 ## This is an alternative method to specify @var{idx}. When specifying it 61 ## This is an alternative method to specify @var{idx}. When specifying it
59 ## in this way, its value can also be the string "all". 62 ## in this way, its value can also be the string "all".
60 ## 63 ##
61 ## @item Info 64 ## @item "Info"
62 ## This option exists for @sc{Matlab} compatibility and has no effect. For 65 ## This option exists for @sc{Matlab} compatibility and has no effect. For
63 ## maximum performance while reading multiple images from a single file, 66 ## maximum performance while reading multiple images from a single file,
64 ## use the Index option. 67 ## use the Index option.
65 ## @end table 68 ## @end table
66 ## 69 ##