Alpha channel in image
Afficher commentaires plus anciens
Hi, I have a white circle (255) and background is black (0), Picture is saved as png and is in grayscale, size 513x513. I need one thing. The white circle has to be transparent and black part no. How can I do this?
x=imread('filter.png');
[M,N]=size(x);
A=zeros(M,N);
for i=1:M
for j=1:N
if (x(i,j)==255)
A(i,j)=1;
end
end
end
imwrite(x,'filter.png','Alpha',A)
but i dont know if it is OK. I have this picture lay on another picture, so in white circle I will see second picture and in black part I will see black. Thanks for any help
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Modify Image Colors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!