
- •In the structure returned from imfinfo function.
- •In addition to these png parameters, you can use any
- •Images), 'rle' (run-length encoding of 1-bit
- •Interleave: The format in which the data is stored. This can be
- •Cdf file handling
- •Image An array of structures containing information
- •IdxMapInfo a structure with 'Map' and 'Size' describing the
- •Vdata | 'Fields'
- •Values for 'Interpolate' are: lon, lat
- •It is written in the file. Each dimension in the file's datasets
- •Hdf version 5 data objects
- •Cdf library interface
- •Inquire - return basic characteristics of cdf
- •InquireVar - return information about cdf variable
- •Hdf version 4 library interface
- •Identifier.
- •Values for funcstr. For example, hdfdf24('lastref') corresponds to the
- •Values for funcstr. For example, hdfdfr8('setpalette',map) corresponds
- •Identifier.
- •In cases where the hdf c library accepts null for certain inputs, an
- •Identical to maxcache, but is -1 if the operation fails.
- •Xdimsize,ydimsize,upleft,lowright)
- •Vector of up to 13 elements containing projection-specific
- •Vector containing the number of values to read along each
- •Is a vector containing the dimension sizes of the subsetted region.
- •Index (zero-based) of the desired level. Fieldlist is a string
- •Vert_field,range)
- •Is an array containing the rank (number of dimensions) for each
- •Is an array of compression parameters. Status is -1 and other
- •Hdf version 5 library interface
- •Iterate - Calls a user function for each attribute
- •Vlen_get_buf_size - Determines storage requirements for vl data
- •Is_hdf5 - Determines if a file is in the hdf5 format
- •Is_simple - Determines if dataspace is simple
- •LibTiff library interface
- •InkSet - Set of inks used in a separated image
- •NetCdf library interface
- •In most cases, the syntax of the matlab function is similar to the
matlab\imagesci – Функции изображения и ввода/вывода данных
Image file import/export
<imformats> - List details about supported file formats.
IMFORMATS Manage file format registry.
FORMATS = IMFORMATS returns a structure containing all of the values in
the file format registry. The fields in this structure are:
ext - A cell array of file extensions for this format
isa - Function to determine if a file "IS A" certain type
info - Function to read information about a file
read - Function to read image data a file
write - Function to write MATLAB data to a file
alpha - 1 if the format has an alpha channel, 0 otherwise
description - A text description of the file format
The values for the isa, info, read, and write fields must be functions
which are on the MATLAB search path or function handles.
FORMATS = IMFORMATS(FMT) searches the known formats for a format with
extension given in the string "FMT." If found, a structure is returned
containing the characteristics and function names. Otherwise an empty
structure is returned.
FORMATS = IMFORMATS(FORMAT_STRUCT) sets the format registry to contain
the values in the "FORMAT_STRUCT" structure. The output structure
FORMATS contains the new registry settings. See the "Warning" statement
below.
FORMATS = IMFORMATS('add', FORMAT_STRUCT) adds the values in the
"FORMAT_STRUCT" structure to the format registry.
FORMATS = IMFORMATS('factory') resets the file format registry to the
default format registry values. This removes any user-specified
settings.
FORMATS = IMFORMATS('remove', FMT) removes the format with extension
FMT from the format registry.
FORMATS = IMFORMATS('update', FMT, FORMAT_STRUCT) change the format
registry values for the format with extension FMT to have the values
stored in FORMAT_STRUCT.
IMFORMATS without any input or output arguments prettyprints a table of
file format information for the supported formats.
Warning:
Using IMFORMATS to change the format registry is an advanced feature.
Incorrect usage may prevent loading of image files. Use IMFORMATS
with the 'factory' setting to return the format registry to a workable
state.
Note:
Changes to the format registry do not persist between MATLAB sessions.
To have a format always available when you start MATLAB, add the
appropriate IMFORMATS commands to the startup.m file in
$MATLAB/toolbox/local.
See also imread, imwrite, imfinfo, fileformats, path.
Reference page in Help browser
doc imformats
<imfinfo> - Return information about graphics file.
IMFINFO Information about graphics file.
INFO = IMFINFO(FILENAME,FMT) returns a structure whose
fields contain information about an image in a graphics
file. FILENAME is a string that specifies the name of the
graphics file, and FMT is a string that specifies the format
of the file. The file must be in the current directory or in
a directory on the MATLAB path. If IMFINFO cannot find a
file named FILENAME, it looks for a file named FILENAME.FMT.
The possible values for FMT are contained in the file format
registry, which is accessed via the IMFORMATS command.
If FILENAME is a TIFF, HDF, ICO, GIF, or CUR file containing more
than one image, INFO is a structure array with one element for
each image in the file. For example, INFO(3) would contain
information about the third image in the file.
INFO = IMFINFO(FILENAME) attempts to infer the format of the
file from its content.
INFO = IMFINFO(URL,...) reads the image from an Internet URL.
The URL must include the protocol type (e.g., "http://").
The set of fields in INFO depends on the individual file and
its format. However, the first nine fields are always the
same. These common fields are:
Filename A string containing the name of the file
FileModDate A string containing the modification date of
the file
FileSize An integer indicating the size of the file in
bytes
Format A string containing the file format, as
specified by FMT; for formats with more than one
possible extension (e.g., JPEG and TIFF files),
the first variant in the registry is returned
FormatVersion A string or number specifying the file format
version
Width An integer indicating the width of the image
in pixels
Height An integer indicating the height of the image
in pixels
BitDepth An integer indicating the number of bits per
pixel
ColorType A string indicating the type of image; this could
include, but is not limited to, 'truecolor' for a
truecolor (RGB) image, 'grayscale', for a grayscale
intensity image, or 'indexed' for an indexed image.
If FILENAME contains Exif tags (JPEG and TIFF only), then the INFO
struct may also contain 'DigitalCamera' or 'GPSInfo' (global
positioning system information) fields.
The value of the GIF format's 'DelayTime' field is given in hundredths
of seconds.
Example:
info = imfinfo('ngc6543a.jpg');
See also imread, imwrite, imformats.
Reference page in Help browser
doc imfinfo
<imread> - Read image from graphics file.
IMREAD Read image from graphics file.
A = IMREAD(FILENAME,FMT) reads a grayscale or color image from the file
specified by the string FILENAME. If the file is not in the current
directory, or in a directory on the MATLAB path, specify the full
pathname.
The text string FMT specifies the format of the file by its standard
file extension. For example, specify 'gif' for Graphics Interchange
Format files. To see a list of supported formats, with their file
extensions, use the IMFORMATS function. If IMREAD cannot find a file
named FILENAME, it looks for a file named FILENAME.FMT.
The return value A is an array containing the image data. If the file
contains a grayscale image, A is an M-by-N array. If the file contains
a truecolor image, A is an M-by-N-by-3 array. For TIFF files containing
color images that use the CMYK color space, A is an M-by-N-by-4 array.
See TIFF in the Format-Specific Information section for more
information.
The class of A depends on the bits-per-sample of the image data,
rounded to the next byte boundary. For example, IMREAD returns 24-bit
color data as an array of uint8 data because the sample size for each
color component is 8 bits. See the Remarks section for a discussion of
bitdepths, and see the Format-Specific Information section for more
detail about supported bitdepths and sample sizes for a particular
format.
[X,MAP] = IMREAD(FILENAME,FMT) reads the indexed image in FILENAME into
X and its associated colormap into MAP. Colormap values in the image
file are automatically rescaled into the range [0,1].
[...] = IMREAD(FILENAME) attempts to infer the format of the file
from its content.
[...] = IMREAD(URL,...) reads the image from an Internet URL. The
URL must include the protocol type (e.g., "http://").
Remarks
Bitdepth is the number of bits used to represent each image pixel.
Bitdepth is calculated by multiplying the bits-per-sample with the
samples-per-pixel. Thus, a format that uses 8-bits for each color
component (or sample) and three samples per pixel has a bitdepth of 24.
Sometimes the sample size associated with a bitdepth can be ambiguous:
does a 48-bit bitdepth represent six 8-bit samples or three 16-bit
samples? The following format-specific sections provide sample size
information to avoid this ambiguity.
Format-Specific Information (Listed Alphabetically by Format)
BMP -- Windows Bitmap
Supported Compression Output
Bitdepths None RLE Class Notes
-----------------------------------------------------------------------
1-bit x - logical
4-bit x x uint8
8-bit x x uint8
16-bit x - uint8 1 sample/pixel
24-bit x - uint8 3 samples/pixel
32-bit x - uint8 3 samples/pixel (1 byte padding)
CUR -- Cursor File
Supported Compression Output
Bitdepths None Compressed Class
--------------------------------------------------
1-bit x - logical
4-bit x - uint8
8-bit x - uint8
Special syntaxes:
[...] = IMREAD(...,IDX) reads in one image from a multi-image icon or
cursor file. IDX is an integer value that specifies the order that the
image appears in the file. For example, if IDX is 3, IMREAD reads the
third image in the file. If you omit this argument, IMREAD reads the
first image in the file.
[A,MAP,ALPHA] = IMREAD(...) returns the AND mask for the resource,
which can be used to determine transparency information. For cursor
files, this mask may contain the only useful data.
GIF -- Graphics Interchange Format
Supported Compression Output
Bitdepths None Compressed Class
--------------------------------------------------
1-bit x - logical
2-to-8 bit x - uint8
Special syntaxes:
[...] = IMREAD(...,IDX) reads in one or more frames from a multiframe
(i.e., animated) GIF file. IDX must be an integer scalar or vector of
integer values. For example, if IDX is 3, IMREAD reads the third image
in the file. If IDX is 1:5, only the first five frames are returned.
[...] = IMREAD(...,'Frames',IDX) is the same as the syntax above except
that IDX can be 'all'. In this case, all of the frames are read and
returned in the order that they appear in the file.
Note: Because of the way GIF files are structured, all of the frames
must be read when a particular frame is requested. Consequently, it is
much faster to specify a vector of frames or 'all' for IDX than to call
IMREAD in a loop when reading multiple frames from the same GIF file.
HDF -- Hierarchical Data Format
Supported Raster image Raster image Output
Bitdepths with colormap without colormap Class Notes
---------------------------------------------------------------------------
8-bit x x uint8
24-bit - x uint8 3 samples/pixel
Special Syntaxes:
[...] = IMREAD(...,REF) reads in one image from a multi-image HDF file.
REF is an integer value that specifies the reference number used to
identify the image. For example, if REF is 12, IMREAD reads the image
whose reference number is 12. (Note that in an HDF file the reference
numbers do not necessarily correspond with the order of the images in
the file. You can use IMFINFO to match up image order with reference
number.) If you omit this argument, IMREAD reads the first image in
the file.
ICO -- Icon File
See CUR.
JPEG -- Joint Photographic Experts Group
Note: IMREAD can read any baseline JPEG image as well as JPEG images
with some commonly used extensions.
Supported Compression Output
Bitdepths Lossy Lossless Class Notes
------------------------------------------------------------------------------
8-bit x x uint8 Grayscale or RGB
12-bit x x uint16 Grayscale
16-bit - x uint16 Grayscale
36-bit x x uint16 RGB(Three 12-bit samples/pixel)
JPEG 2000 - Joint Photographic Experts Group 2000
Supported Compression Output
Bitdepths Lossy Lossless Class
(per sample)
----------------------------------------------------------
1-bit x x logical
2- to 8-bit x x uint8
9- to 16-bit x x uint16
Note: Indexed JPEG 2000 images are not supported. Only JP2 compatible
color spaces are supported for JP2/JPX files. Arbitrary channels are
supported for raw codestream J2C files.
Special Syntaxes
[...] = IMREAD(..., 'Param1', value1, 'Param2', value2, ...) uses
parameter-value pairs to control the read operation.
Parameter name Value
------------------- -----
'ReductionLevel' A non-negative integer specifying reduction in
the resolution of the image. For a reduction
level 'L', the image resolution is reduced by a
factor of 2^L. Its default value is 0 implying
no reduction. The reduction level is limited by
the total number of decomposition levels as
provided by 'WaveletDecompositionLevels' field
In the structure returned from imfinfo function.
'PixelRegion' {ROWS, COLS}. IMREAD returns the sub-image
specified by the boundaries in ROWS and COLS.
ROWS and COLS must both be two-element vectors
that denote the 1-based indices [START STOP]. If
'ReductionLevel' is greater than 0, then ROWS and
COLS are coordinates in the reduced-sized image.
'V79Compatible' A BOOL value. If true, image returned is color
converted to gray-scale or RGB image as consistent
with previous versions of IMREAD (MATLAB 7.9
[R2009b] and earlier). Otherwise raw color
image is returned. Default is false.
PBM -- Portable Bitmap
Supported Raw ASCII (Plain) Output
Bitdepths Binary Encoded Class
--------------------------------------------------
1-bit x x logical
PCX -- Windows Paintbrush
Supported Output
Bitdepths Class Notes
----------------------------------------------
1-bit logical Grayscale only
8-bit uint8 Grayscale or indexed
24-bit uint8 RGB (8-bit samples)
PGM -- Portable Graymap
Supported Raw ASCII (Plain) Output
Bitdepths Binary Encoded Class
-------------------------------------------------------
up to 16-bit x - uint8
Arbitrary - x
PNG -- Portable Network Graphics
Supported Output
Bitdepths Class Notes
-------------------------------------------
1-bit logical Grayscale only
2-bit uint8 Grayscale only
4-bit uint8 Grayscale only
8-bit uint8 Grayscale or Indexed
16-bit uint16 Grayscale or Indexed
24-bit uint8 RGB (Three 8-bit samples/pixel)
48-bit uint16 RGB (Three 16-bit samples/pixel)
Special Syntaxes:
[...] = IMREAD(...,'BackgroundColor',BG) composites any transparent
pixels in the input image against the color specified in BG. If BG is
'none', then no compositing is performed. Otherwise, if the input image
is indexed, BG should be an integer in the range [1,P] where P is the
colormap length. If the input image is grayscale, BG should be an
integer in the range [0,1]. If the input image is RGB, BG should be a
three-element vector whose values are in the range [0,1]. The string
'BackgroundColor' may be abbreviated.
If the ALPHA output argument is used (see below), then BG defaults to
'none' if not specified by the user. Otherwise, if the PNG file
ontains a background color chunk, that color is used as the default
value for BG. If ALPHA is not used and the file does not contain a
background color chunk, then the default value for BG is 1 for indexed
images; 0 for grayscale images; and [0 0 0] for RGB images.
[A,MAP,ALPHA] = IMREAD(...) returns the alpha channel if one is
present; otherwise ALPHA is []. If 'BackgroundColor' is specified by
the user then ALPHA is []. Note that MAP may be empty if the file
contains a grayscale or truecolor image.
PPM -- Portable Pixmap
Supported Raw ASCII (Plain) Output
Bitdepths Binary Encoded Class
----------------------------------------------------
up to 16-bit x - uint8
Arbitrary - x
RAS -- Sun Raster
Supported Output
Bitdepths Class Notes
----------------------------------------------------
1-bit logical Bitmap
8-bit uint8 Indexed
24-bit uint8 RGB (8-bit samples)
32-bit uint8 RGB with Alpha (8-bit samples)
TIFF -- Tagged Image File Format
Supported Compression Output Bitdepths None Packbits CCITT RGB ICCLAB CIELAB CMYK Class Notes
-------------------------------------------------------------------------------------------------
1-bit x x x - - - - logical
8-bit x x - - - - - uint8
12-bit - - - - - - - uint16 Grayscale
or Indexed
16-bit - - - - - - - uint16 Grayscale
or Indexed
24-bit x x - x x x - uint8 3 samples
32-bit - - - - - - x uint8 4 samples
36-bit - - - x - - - uint16 3 samples
48-bit - - - x x x - uint16 3 samples
64-bit - - - - - - x double 4 samples
NOTE: IMREAD supports 8-bit integral and 32-bit floating point tiled
TIFF images, with any compression and colorspace combination listed
above, and 32-bit IEEE floating point images.
Special Syntaxes:
A = IMREAD(...) returns color data that uses the RGB, CIELAB, ICCLAB,
or CMYK color spaces. If the color image uses the CMYK color space, A
is an M-by-N-by-4 array.
[...] = IMREAD(..., 'Param1', value1, 'Param2', value2, ...) uses
parameter-value pairs to control the read operation. There are three
different parameters you can use:
Parameter name Value
-------------------- -----
'Index' A positive integer specifying which image to read in
a multi-image TIFF file. For example, if 'Index' is
3, IMREAD reads the third image in the file.
'Info' A structure array; the output of IMFINFO. When
reading images from a multi-image TIFF file, passing
the output of IMFINFO as the 'Info' parameter helps
IMREAD locate the images in the file more quickly.
'PixelRegion' {ROWS, COLS}. IMREAD returns the sub-image
specified by the boundaries in ROWS and COLS. ROWS
and COLS must be either two- or three-element
vectors. If two elements are provided, they denote
the 1-based indices [START STOP]. If three elements
are provided, the indices [START INCREMENT STOP]
allow image downsampling.
XWD -- X Window Dump
Supported Output
Bitdepths ZPixmaps XYBitmaps XYPixmaps Class
--------------------------------------------------------------------
1-bit x - x logical
8-bit x - - uint8
Please read the file libtiffcopyright.txt for more information.
Example:
imdata = imread('ngc6543a.jpg');
See also imfinfo, imwrite, imformats, fread, image, double, uint8.
Reference page in Help browser
doc imread
<imwrite> - Write image to graphics file.
IMWRITE Write image to graphics file.
IMWRITE(A,FILENAME,FMT) writes the image A to the file specified by
FILENAME in the format specified by FMT.
A can be an M-by-N (grayscale image) or M-by-N-by-3 (color image)
array. A cannot be an empty array. If the format specified is TIFF,
IMWRITE can also accept an M-by-N-by-4 array containing color data
that uses the CMYK color space.
FILENAME is a string that specifies the name of the file.
FMT is a string specifying the format of the file. See the reference
page, or the output of the IMFORMATS function, for a list of
supported formats.
IMWRITE(X,MAP,FILENAME,FMT) writes the indexed image in X and its
associated colormap MAP to FILENAME in the format specified by FMT.
If X is of class uint8 or uint16, IMWRITE writes the actual values in
the array to the file. If X is of class double, IMWRITE offsets the
values in the array before writing, using uint8(X-1). MAP must be a
valid MATLAB colormap. Note that most image file formats do not
support colormaps with more than 256 entries.
When writing multiframe GIF images, X should be an 4-dimensional
M-by-N-by-1-by-P array, where P is the number of frames to write.
IMWRITE(...,FILENAME) writes the image to FILENAME, inferring the
format to use from the filename's extension. The extension must be
one of the legal values for FMT.
IMWRITE(...,PARAM1,VAL1,PARAM2,VAL2,...) specifies parameters that
control various characteristics of the output file. Parameters are
currently supported for GIF, HDF, JPEG, TIFF, PNG, PBM, PGM, and PPM
files.
Class Support
-------------
The input array A can be of class logical, uint8, uint16, or double.
Indexed images (X) can be of class uint8, uint16, or double; the
associated colormap, MAP, must be double. Input values must be
full (non-sparse).
The class of the image written to the file depends on the format
specified. For most formats, if the input array is of class uint8,
IMWRITE outputs the data as 8-bit values. If the input array is of
class uint16 and the format supports 16-bit data (JPEG, PNG, and
TIFF), IMWRITE outputs the data as 16-bit values. If the format does
not support 16-bit values, IMWRITE issues an error. Several formats,
such as JPEG and PNG, support a parameter that lets you specify the
bit depth of the output data.
If the input array is of class double, and the image is a grayscale
or RGB color image, IMWRITE assumes the dynamic range is [0,1] and
automatically scales the data by 255 before writing it to the file as
8-bit values.
If the input array is of class double, and the image is an indexed
image, IMWRITE converts the indices to zero-based indices by
subtracting 1 from each element, and then writes the data as uint8.
If the input array is of class logical, IMWRITE assumes the data is a
binary image and writes it to the file with a bit depth of 1, if the
format allows it. BMP, PNG, or TIFF formats accept binary images as
input arrays.
GIF-specific parameters
-----------------------
'WriteMode' One of these strings: 'overwrite' (the default)
or 'append'. In append mode, a single frame is
added to the existing file.
'Comment' A string or cell array of strings containing a
comment to be added to the image. For a cell
array of strings, a carriage return is added
after each row.
'DisposalMethod' One of the following strings, which sets the
disposal method of an animated GIF:
'leaveInPlace', 'restoreBG', 'restorePrevious',
or 'doNotSpecify'.
'DelayTime' A scalar value between 0 and 655 inclusive, which
specifies the delay in seconds before displaying
the next image.
'TransparentColor' A scalar integer. This value specifies which
index in the colormap should be treated as the
transparent color for the image. If X is uint8
or logical, then indexing starts at 0. If X is
double, then indexing starts at 1.
'BackgroundColor' A scalar integer. This value specifies which
index in the colormap should be treated as the
background color for the image and is used for
certain disposal methods in animated GIFs. If X
is uint8 or logical, then indexing starts at 0.
If X is double, then indexing starts at 1.
'LoopCount' A finite integer between 0 and 65535 or the value
Inf (the default) which specifies the number of
times to repeat the animation. By default, the
animation will continuously loop. For a value of
0, the animation will be played once. For a
value of 1, the animation will be played twice,
etc.
'ScreenSize' A two element vector specifying the screen height
and width of the frame. When used with
'Location', this provides a way to write frames
to the image which are smaller than the whole
frame. The remaining values are filled in
according to the 'DisposalMethod'.
'Location' A two element vector specifying the offset of the
top left corner of the screen relative to the top
left corner of the image. The first element is
the offset from the top, and the second element
is the offset from the left.
HDF-specific parameters
-----------------------
'Compression' One of these strings: 'none' (the default),
'rle' (only valid for grayscale and indexed
images), 'jpeg' (only valid for grayscale
and RGB images)
'Quality' A number between 0 and 100; parameter applies
only if 'Compression' is 'jpeg'; higher
numbers mean quality is better (less image
degradation due to compression), but the
resulting file size is larger
'WriteMode' One of these strings: 'overwrite' (the
default) or 'append'
JPEG-specific parameters
------------------------
'Quality' A number between 0 and 100; higher numbers
mean quality is better (less image degradation
due to compression), but the resulting file
size is larger
'Comment' A column vector cell array of strings or a
char matrix. Each row of input is written out
as a comment in the JPEG file.
'Mode' Either 'lossy' (the default) or 'lossless'
'BitDepth' A scalar value indicating desired bitdepth;
for grayscale images this can be 8, 12, or 16;
for truecolor images this can be 8 or 12. Only
lossless mode is supported for 16-bit images.
JPEG2000-specific parameters
----------------------------
'Mode' Either 'lossy' (the default) or 'lossless'.
'CompressionRatio' A real value greater than 1 specifying the target
compression ratio which is defined as the ratio of
input image size to the output compressed size. For
example, a value of 2.0 implies that the output
image size will be half of the input image size or
less. A higher value implies a smaller file size and
reduced image quality. This is valid only with
'lossy' mode. Note that the compression ratio
doesn't take into account the header size, and hence
in some cases the output file size can be larger
than expected.
'ProgressionOrder' A string that is one of 'LRCP', 'RLCP', 'RPCL',
'PCRL' or 'CPRL'. The four character identifiers are
interpreted as L=layer, R=resolution, C=component
and P=position. The first character refers to the
index which progresses most slowly, while the last
refers to the index which progresses most quickly.
The default value is 'LRCP'.
'QualityLayers' A positive integer (not exceeding 20) specifying the
number of quality layers. The default value is 1.
'ReductionLevels' A positive integer (not exceeding 8) specifying the
number of reduction levels or the wavelet
decomposition levels.
'TileSize' A 2-element vector specifying tile height and tile
width. The minimum tile size that can be specified
is [128 128]. The default tile size is same as the
image size.
'Comment' A cell array of strings or a char matrix. Each row
of input is written out as a comment in the JPEG2000
file.
TIFF-specific parameters
------------------------
'Colorspace' One of these strings: 'rgb', 'cielab', or
'icclab'. The default value is 'rgb'. This
parameter is used only when the input array,
A, is M-by-N-by-3. See the reference page
for more details about creating L*a*b* TIFF
files.
In order to create a CMYK TIFF, the colorspace
parameter should not be used. It is sufficient
to specify the input array A as M-by-N-by-4.
'Compression' One of these strings: 'none', 'packbits'
(default for nonbinary images), 'lzw', 'deflate',
'jpeg', 'ccitt' (default for binary images),
'fax3', 'fax4'; 'ccitt', 'fax3', and
'fax4' are valid for binary images only.
'jpeg' is a lossy compression scheme; other
compression modes are lossless.
When using JPEG compression, the 'RowsPerStrip'
parameter must be specified and must be a multiple
of 8.
'Description' Any string; fills in the ImageDescription
field returned by IMFINFO
'Resolution' A two-element vector containing the
XResolution and YResolution, or a scalar
indicating both resolutions; the default value
is 72
'RowsPerStrip' A scalar value. The default will be such that each
strip is about 8K bytes.
'WriteMode' One of these strings: 'overwrite' (the
default) or 'append'
PNG-specific parameters
-----------------------
'Author' A string
'Description' A string
'Copyright' A string
'CreationTime' A string
'ImageModTime' A MATLAB datenum or a string convertible to a
date vector via the DATEVEC function. Values
should be in UTC time.
'Software' A string
'Disclaimer' A string
'Warning' A string
'Source' A string
'Comment' A string
'InterlaceType' Either 'none' or 'adam7'
'BitDepth' A scalar value indicating desired bitdepth;
for grayscale images this can be 1, 2, 4,
8, or 16; for grayscale images with an
alpha channel this can be 8 or 16; for
indexed images this can be 1, 2, 4, or 8;
for truecolor images with or without an
alpha channel this can be 8 or 16
'Transparency' This value is used to indicate transparency
information when no alpha channel is used.
For indexed images: a Q-element vector in
the range [0,1]; Q is no larger than the
colormap length; each value indicates the
transparency associated with the
corresponding colormap entry
For grayscale images: a scalar in the range
[0,1]; the value indicates the grayscale
color to be considered transparent
For truecolor images: a 3-element vector in
the range [0,1]; the value indicates the
truecolor color to be considered
transparent
You cannot specify 'Transparency' and
'Alpha' at the same time.
'Background' The value specifies background color to be
used when compositing transparent pixels.
For indexed images: an integer in the range
[1,P], where P is the colormap length
For grayscale images: a scalar in the range
[0,1]
For truecolor images: a 3-element vector in
the range [0,1]
'Gamma' A nonnegative scalar indicating the file
gamma
'Chromaticities' An 8-element vector [wx wy rx ry gx gy bx
by] that specifies the reference white
point and the primary chromaticities
'XResolution' A scalar indicating the number of
pixels/unit in the horizontal direction
'YResolution' A scalar indicating the number of
pixels/unit in the vertical direction
'ResolutionUnit' Either 'unknown' or 'meter'
'Alpha' A matrix specifying the transparency of
each pixel individually; the row and column
dimensions must be the same as the data
array; may be uint8, uint16, or double, in
which case the values should be in the
range [0,1]
'SignificantBits' A scalar or vector indicating how many
bits in the data array should be regarded
as significant; values must be in the range
[1,bitdepth]
For indexed images: a 3-element vector
For grayscale images: a scalar
For grayscale images with an alpha channel:
a 2-element vector
For truecolor images: a 3-element vector
For truecolor images with an alpha channel:
a 4-element vector