reference
labkit.image.writeFile
Write one image file, creating the parent folder when needed.
Syntax
labkit.image.writeFile(imageData, filepath)Description
Writes imageData with MATLAB imwrite. The extension in filepath selects the output format. If the parent folder does not exist, the function creates it, including intermediate folders supported by mkdir. Existing files are replaced according to imwrite behavior.
The function does not rescale, clamp, or otherwise normalize imageData. Errors from folder creation and imwrite propagate to the caller.
Inputs
imageData- Image matrix accepted by MATLAB imwrite.
filepath- Nonempty character vector or scalar string. The filename extension controls the output format.
Outputs
None.
Errors
labkit:image:InvalidOutputPath- filepath is empty or nonscalar. Other folder and image-format errors are raised by mkdir or imwrite.
Typical Call
labkit.image.writeFile(processedImage, fullfile(outputFolder, "result.png"));Related APIs
labkit.image.readFiles— Read image files into path/name/image records.labkit.image.displayName— Return a short image-file display name.labkit.image.adjustBrightnessContrast— Apply simple brightness and contrast adjustment.labkit.image.adjustHueSaturation— Apply HSV hue and saturation adjustment.labkit.image.assertSupportedPaths— Throw when any path has an unsupported image extension.labkit.image.ensureRgb— Return image data with exactly three color channels.labkit.image.fileDialogFilter— Return a file-chooser-compatible image filter.labkit.image.grayWorldWhiteBalance— Apply generic gray-world white balance.
Source
This page is generated from the MATLAB help text in +labkit/+image/writeFile.m.