Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1067

Image.pixel() always returns 255

$
0
0

I want to set the alpha value of a pixel of one image to the value of the alpha value of a pixel of another image. Unfortunately, Image.pixel() always returns 255 for the alpha value. Since I'm working with image sections, I probably can't use the composite methods either, since they always process the entire image.

var imageTrans = new Image(100, 100, Image.Format_ARGB32);

imageTrans.fill(new Color(0, 0, 0, 0));

print("Alpha:", imageTrans.pixel(0, 0).alpha);

imageTrans.save(sDir + "/imageTrans.png");

// In the output file you can see the transparency.

Does anyone have an idea how I can achieve the desired goal?
 


Viewing all articles
Browse latest Browse all 1067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>