Search the Community
Showing results for tags 'copychannel'.
Found 1 result
Merge a grayscale image as an alpha channelHi, I am trying to "hack" the spritesheets limitations by using JPG images with alpha channel. The process is simple: - I have a starting PNG with alpha channel - from this PNG I save a JPG (with varying fill colour for originally transparent areas) - from the PNG I extract the alpha channel and save it as an opaque indexed colour grayscale image - I load the new JPG and the grayscale PNG, and use the PNG as alpha channel for the JPG. These are the two images, the JPG and the grayscale PNG animBitmapData is BitmapData from the JPG animBitmapData_ALPHA is BitmapData from the grayscale PNG I did everything, but the last step doesn't work, animBitmapData is still opaque animBitmapData.copyChannel(animBitmapData_ALPHA, animBitmapData_ALPHA.rect, new Point(0, 0), BitmapDataChannel.ALPHA, BitmapDataChannel.RED);animBitmapData.transparent returns false, could this be the problem? Or maybe it is not correct to use a grayscale image as alpha channel? - Coding in Haxe + OpenFl -