Overlaying a semi-transparent color over an image
8 views (last 30 days)
Show older comments
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 Comments
Answers (3)
Walter Roberson
on 6 Aug 2015
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 Comments
Image Analyst
on 6 Aug 2015
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 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!