how to save PNG file with imwrite function?

  • Follow


I have saved png file with imwrite like:

================================
>>[t,map,alpha]=imread('test.png');
....
>>imwrite(t,'test.png','Alpha',alpha);
================================

It worked fine. however, if the alpha is not assigned by reading from
an exsited png file,
there will be some problems.

tArea is the area I need to save.
alpha is a matrix with the same size as tArea

================================
alpha = zeros(size(tArea));
alpha(tArea~=0) = 1;
imwrite(tArea,'tArea.png','Alpha',alpha); % the saved image is totally
blank
================================

How can I fix it?
0
Reply xenoszh (14) 3/6/2010 9:15:23 AM


0 Replies
1201 Views

(page loaded in 0.024 seconds)

Similiar Articles:













7/20/2012 3:14:36 AM


Reply: