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

37 次查看(过去 30 天)
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?

采纳的回答

sixwwwwww
sixwwwwww 2013-12-5
编辑:sixwwwwww 2013-12-5
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 个)

barbara anderson
barbara anderson 2020-4-15
Convert it into greyscale image and plot it.

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by