Overlaying a semi-transparent color over an image
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(3 个)
Walter Roberson
2015-8-6
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.
0 个评论
Image Analyst
2015-8-6
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!