How can I plot an image in matlab. This is giving me a Black png image!
35 ビュー (過去 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?
2 件のコメント
採用された回答
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 件のコメント
Tejas Waje
2017 年 1 月 10 日
If I have a background image and I need to use a foreground image with some part transparent , what should I do?
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!