Great! I didn't know it was that simple, but if I have an indexed image I created with ImageCmap, how would I first convert it to a direct image so that I'll be able to concatenate the alpha layer?
On Tuesday, June 24, 2014 9:30:00 PM UTC+10, Tim Holy wrote: > > If your image has transparency, then imwrite(I, "name.png") should Just > Work. > > There are many ways to get an image with transparency: for example, you > might > load one from disk. If you want to construct one "from scratch," here's a > demo: > > A = rand(100, 128, 4); # random colors > A[:,:,1] = linspace(0,1,100) .* ones(1,128); # alpha gradient > img = colorim(A, "ARGB") > > This builds an ARGB image. You could alternatively choose an RGBA image if > you > prefer (for which A is the 4th channel). > > --Tim > > > On Monday, June 23, 2014 10:00:44 PM Yakir Gagnon wrote: > > How, if possible, can I imwrite a PNG image that has transparency in it? > > I'm assuming something like: > > > > using Images > > imwrite( I,"name.png",alpha=A) > > > > Thanks! >
