How to save image that used AlphaData function?
7 次查看(过去 30 天)
显示 更早的评论
I am using the transparency on watershed,
Lrgb=label2rgb(L,'jet','w','shuffle');
imshow(Lrgb), title('Colored Watershed Label Matrix (Lrgb)')
imshow(I)
hold on
himage=imshow(Lrgb);
himage.AlphaData=0.3;
title('Lrgb Superimposed Transparently on Original Image')
imwrite(himage,'newWAimage.png','PNG');
I want to save the superimposed image using imwrite since i need my image the same size as the original images but "matlab.graphics.primitive.Image." error occurs.
I did use saveas function however the output size image is different than the original image.
Is there any other way to save the superimposed image? Do I need to change the transparency code?
3 个评论
Walter Roberson
2019-3-13
Yes, setting himage.AlphaData=0.3 will write over the effects of alpha color
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
