Read image using RGBA interface
[RGB,alpha] = readRGBAImage(t)
example
[RGB,alpha] = readRGBAImage(t) reads the image and alpha matting data from the TIFF file associated with the Tiff object t using the RGBA interface.
RGB
alpha
t
Tiff
collapse all
Get all image data and its associated alpha matting from a TIFF file.
Create a Tiff object for an image file.
t = Tiff('example.tif','r');
Read the image data and the associated alpha matting.
[RGB,A] = readRGBAImage(t);
Display the image.
imshow(RGB)
Close the Tiff object.
close(t);
Tiff object representing a TIFF file. Use the Tiff function to create the object.
Image data, returned as a m-by-n-by-3 numeric array. Where m and n are the height and width of the image, respectively.
m
n
3
The readRGBAImage function can transform the pixel values based on specifications in these tags:
readRGBAImage
PhotometricInterpretation
BitsPerSample
SamplesPerPixel
Orientation
ExtraSamples
ColorMap
Alpha matting associated with the image, returned as an m-by-n numeric array. Where m and n are the height and width of the image, respectively.
If the image does not have associated alpha matting, then alpha is a matrix with all values set to 255 (transparent).
255
This function corresponds to the TIFFReadRGBAImage function in the LibTIFF C API. To use this function, you must be familiar with the TIFF specification and technical notes. View this documentation at LibTIFF - TIFF Library and Utilities.
TIFFReadRGBAImage
LibTIFF - TIFF Library and Utilities
read | readRGBAStrip | readRGBATile
read
readRGBAStrip
readRGBATile
You have a modified version of this example. Do you want to open this example with your edits?