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

조회 수: 108 (최근 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
Tejas Waje
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개)

barbara anderson
barbara anderson 2020년 4월 15일
Convert it into greyscale image and plot it.

Community Treasure Hunt

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

Start Hunting!

Translated by