We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › inconsistent line rasterization with alpha
Page Index Toggle Pages: 1
inconsistent line rasterization with alpha (Read 1268 times)
inconsistent line rasterization with alpha
Feb 22nd, 2007, 6:16pm
 
There appears to be a problem drawing 45-degree lines when the stroke is partially transparent.  The lines are rasterized with "extra" pixels, producing a heavier line than expected.

The problem does not seem to occur when the stroke is opaque.  And it only happens on 45/225-degree "forward slash" lines, not 135/315-degree "backslash" lines.

Quote:


// to demonstrate rasterization problem with lines
// at certain angles when partially transparent

size(200,200);
background(255);
noSmooth(); // is default, but make sure
strokeWeight(1); // is default, but make sure

stroke(0); // reference:  all lines rasterize correctly when opaque
line(20,20, 10,10);
line(20,20, 30,10);
line(20,20, 10,30);
line(20,20, 30,30);

stroke(0,192); // exact alpha value doesn't appear to matter, as long as < 255
line(120,20, 110,10); // ok
line(120,20, 130,10); // incorrect staircasing
line(120,20, 110,30); // incorrect staircasing
line(120,20, 130,30); // ok


Re: inconsistent line rasterization with alpha
Reply #1 - Apr 20th, 2007, 2:28pm
 
that's unfortunately a problem with java2d, or specific to your platform or implementation or graphics card. you'd have to file it with sun (if you're using the windows version) or apple (if you're on a mac).
Page Index Toggle Pages: 1