//TAKEN FROM STACK OVERFLOW:--------------------------------------------
Your problem is caused by the fact that Flash uses pre-multiplied alpha. Usually this is not a big issue, but it becomes very apparent if you have pixel values with very low alpha values which unfortunately are very common when you use a blurred soft-feathered brush. The pre-multiplication causes an information loss in the pixels - and when you have low alpha values the color values are effectively getting rounded down which when you are drawing slowly in your app and the same pixels are getting drawn over each other again and again will cause the area to get darker and darker. For some more details on the pre-multiplication issue check an old post of mine: http://www.quasimondo.com/archives/000665.php There is nothing you can do about this except if you handle the alpha channel and the rgb channel separately. But then you will also have to do all the compositing yourself which is not a trivial task and might slow down your app too much.
-------------------------------------------------------------------------Hmm... Even if it was fixable, saving out PNG files with the correct alpha channel would still have problems. Don't use alpha channel.
1234 5678 --Set bits describe which channel pixel exists on. [1111 1111]R [1111 1111]G [1111 1111]B Thus, each pixel becomes defined by 3 bits. There are 8 possible combinations for bits: BINARY RGB-EQUIVALENT:
000 [000,000,000] BLACK
001 [000,000,255] BLUE
010 [000,255,000] GREEN
011 [000,255,255] CYAN
100 [255,000,000] RED
101 [255,000,255] MAGENTA
110 [255,255,000] YELLOW
111 [255,255,255] WHITE
No comments:
Post a Comment