[HTML5] Assets.getBitmapData() returns transparent BitmapData for JPG


#1
var bd:BitmapData = Assets.getBitmapData("any.jpg");
trace(bd.transparent);//true

Is this by design, or by accident? :slight_smile:


#2

I think it is by design, otherwise you can’t modify the alpha layer using the BitmapData API, would be interesting how Flash works?


#3

In Flash it is false for loaded JPGs and true for PNGs.
I wonder if non-transparent bitmaps are faster in copying/drawing?


#4

Perhaps we should use true for embedded, but false for remotely loaded ones? The hard part is you can’t make it transparent without creating a copy


#5

I don’t know…
But I think that most of the loaded JPGs aren’t used for transparency transformations…