Overlaying a semi-transparent color over an image
显示 更早的评论
I thought that this would be fairly simple, and maybe it is, but unfortunately reading Steve's blog post describing something similar to this didn't help. I have a a png image with an alpha channel. I would like to concatenate this image with an overlay of a a color on top of it. The overlay would obviously have the same dimensions. I still want to be able to see the background image, I just want a semi-transparent color overlayed on top of it. I think that it's important to concatenate the image with the overlay, because I will be showing several images that fit together on the same figure, so I will be using each of the original images alphaData, so that the pictures don't cover each other up.
Sorry if this actually is very straight forward, I just haven't gotten it to work for me.
回答(3 个)
Jeff E
2015-8-5
0 个投票
Walter Roberson
2015-8-6
0 个投票
You cannot do this by concatenating together images. For MATLAB graphics, each image must have either 1 or 3 colorplanes. Each image may have an associated Alpha channel, which can be a scalar (in which case it applies to all locations) or the Alpha may be an array the same size as the image, indicating transparency on a pixel-by-pixel basis.
You can have multiple images in an axes. The last one added will be "on top" in 2D scenes... mostly... not always.
Image Analyst
2015-8-6
0 个投票
Why don't you just create a new image that is the average or weighted average of all the RGB images you want to show in that axes? How many overlays/graphics channels will be on top of the group of images? Maybe you could do the same with those to create just one overlay channel.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!