Notifications
Clear all
[Closed] Copy bitmap alpha
Sep 15, 2012 7:58 pm
Hi everyone! My goal was simple: take 1 bitmap, take another, and copy alpha channel b1.a = b2.r
Plenty of solutions: setPixel, pastBitmap e.t.c
But nothing is working ;_; I’ve spent whole day googling. Maybe there is a catch somewhere?
This is how I get bitmaps from substance:
sbsMat.DiffuseMap.outputChannelIndex = 2
_filename1_ = "C:\ 1.png"
meditMaterials[1] = copy sbsMat
rm = renderMap meditMaterials[1].diffuseMap size:[_width,_height] \
fileName: (_filename1_)
Same for 2nd bitmap.
If I save them to file, I get 2 good looking pngs. One with color. Other black-white mask as it should. And no extra alpha channels ;_;
I did this prior too:
pngio.setType #true24
pngio.setAlpha true
Maybe renderMap function is bugged or it returns bitmap without alpha channel and I have to add it manually somrhow?