imwrite

Write image to graphics file.

📝 Syntax

  • imwrite(A, filename)

  • imwrite(A, map, filename)

  • imwrite(..., fmt)

  • imwrite(..., , propertyName, propertyValue)

📥 Input argument

  • A - matrix: 3D for color and 2D for gray or indexed image.

  • map - Colormap of indexed image:m-by-3 array.

  • fmt - Format of output file: 'bmp', 'png', 'jpg', 'gif', ...

  • filename - a row vector characters or scalar string: name of graphics file.

  • propertyName - a scalar string or row vector character.

  • propertyValue - a value.

📄 Description

imwrite(A, filename) writes image dataA to the file specified by filename

Property name:

Quality: quality of output file: scalar in the range [0, 100] (75 as default).

Alpha: matrix of values in the range [0, 1]: Transparency of each pixel.

Comment: character vector, string scalar, cell array of character vectors or string array: Comment added to image.

Author: character vector or string scalar: Author information.

Properties for gif format:

WriteMode:

LoopCount:

DelayTime:

💡 Examples

gif animation

🔗 See also

imread, imshow, imformats.

🕔 History

Version
📄 Description

1.0.0

initial version

1.13.0

gif animation, pcx format added

Last updated

Was this helpful?