How to make one color transparent in a PNG?
7 次查看(过去 30 天)
显示 更早的评论
Hi, I am making maps and want to have the land transparent to then overlay over Google maps. The way around it I think is to creat the figure with land in black (as nothing else in the image is black) and the have that color made trasnaprent. I have not been able to do this so far... Here's the code, I appreciate anyone pointing me in the right direction. thanks

2 个评论
the cyclist
2019-11-1
It's better to paste code than an image of code. Otherwise, if someone wants to try it out, they need to retype everything.
回答(2 个)
Sahithi Kanumarlapudi
2019-11-4
You can change the transparency of a color in an image using ‘AlphaData’ property. The following link has an example
In order to change the transparency of an object on an axis you can use ‘alpha’ property. For more information refer to the following link
Hope this helps!
0 个评论
Walter Roberson
2019-11-4
print() to the png file. Then read in the file and write out a new copy of it that has the appropriate color set as transparent. See
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!