Open main menu

CDOT Wiki β

Changes

User:Minooz/OSD600/processing

913 bytes added, 14:59, 20 April 2011
no edit summary
: Those characteristics where changed in ''pGraphics.java'':
:: several instances of: line 5302: <pre> calcAlpha = (calcAi != 255); // changed to check for equality to 255</pre>
: Since the pixels were the same, seems like p5 has some difference in setting that shows the first underneath layer which is the background pixels in case of transparency of image. But browsers react differently. They display the pixels of window.
: The other strange issue was that chrome displays actually the color of the window as is defined in ''bgcolor'' whereas firefox just fills the transparent pixels with black color.
 
*''' Final Solution'''
: So, we got nowhere in comparing these 2 together, so we decided to go around it and solve it this way:
<source lang="java">
if (img.format !== PConstants.RGB && destPixels[(destOffset + x) * 4] !== 255) {
 
14892
 
+ destColor = p.color.toArray(p.modes.blend(destColor, p.filter_bilinear()));
 
14893
 
+ } else {
 
14894
 
+ destColor = p.color.toArray(p.filter_bilinear());
 
14895
 
+ }
</source>
1
edit