Why does imread read the alpha channel, but not the image itself?
Show older comments
Hi all,
I would like to read a png with transparent background in MATLAB (2014b, Windows 7) using imread:
[icon, map, alpha] = imread('icon.png');
However, icon is now only zeros, but the alpha channel is read correctly (the map is empty as well). I made the png with Photoshop and I tried several options, such as making the image indexed, RGB, grayscale, 8 bits, 32 bits, et cetera.
Does anyone have an idea about why my alpha channel is read correctly, but the image data is black? How should I save the image from Photoshop such that it is read in MATLAB? Thanks in advance!
Kind regards, Mark
Accepted Answer
More Answers (1)
Raphael
on 6 Apr 2018
Edited: Walter Roberson
on 7 Apr 2018
1 vote
1 Comment
Walter Roberson
on 7 Apr 2018
Notice, though, that "icon is now only zeros", so something else was going wrong for the user.
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!