How can I plot an image in matlab. This is giving me a Black png image!

40 vues (au cours des 30 derniers jours)
URL ='http://structures.wishartlab.com/molecules/HMDB00126/image.png'
filename='test.png'
urlwrite(URL,filename)
[y,z]=imread(filename,'png');
figure, imshow(y);
colormap(z)
This is giving me a Black image! How can i Plot it without getting all black?
  2 commentaires
sixwwwwww
sixwwwwww le 4 Déc 2013
I am getting this image from your code. Is it correct?
Rafael Freire
Rafael Freire le 4 Déc 2013
Yes its look like this but the correct one must be like this http://structures.wishartlab.com/molecules/HMDB00126/image.png

Connectez-vous pour commenter.

Réponse acceptée

sixwwwwww
sixwwwwww le 5 Déc 2013
Modifié(e) : sixwwwwww le 5 Déc 2013
you can do it as follows:
URL ='http://structures.wishartlab.com/molecules/HMDB00126/image.png'
filename = 'test.png'
urlwrite(URL,filename)
y = imread(filename, 'BackgroundColor', [1 1 1]);
figure, imshow(y);
The problem here was to replace transparent pixels with some specific color. If we don't choose any specific color then MATLAB gives it black color
  1 commentaire
Tejas Waje
Tejas Waje le 10 Jan 2017
If I have a background image and I need to use a foreground image with some part transparent , what should I do?

Connectez-vous pour commenter.

Plus de réponses (1)

barbara anderson
barbara anderson le 15 Avr 2020
Convert it into greyscale image and plot it.

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by