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.
IndexProgramming Questions & HelpSyntax Questions › Image rotation makes strong aliasing artifacts
Page Index Toggle Pages: 1
Image rotation makes strong aliasing artifacts (Read 262 times)
Image rotation makes strong aliasing artifacts
Nov 17th, 2008, 1:29pm
 
Hi,
I need to rotate a bitmap image and I'm a bit disappointed by the quality of the result.
There is a lot of aliasing artifacts...
Is there a solution to improve this result?

Thanks

I'm using this code to test the rotation:



PImage bigImage;
int n = 100;
int IMAGE_SIZE = 3000;

void setup()
{
 PGraphics bigImage = createGraphics(IMAGE_SIZE, IMAGE_SIZE, JAVA2D);
 PImage poil = loadImage("p6trans.png");
 bigImage.beginDraw();
 bigImage.background(255);
 for (int i = 0; i < n; i++)
 {
   bigImage.translate(IMAGE_SIZE/2, IMAGE_SIZE/2);
   bigImage.rotate(i);
   bigImage.tint(random(255), random(255), random(255));
   bigImage.image(poil, 0,0);
   bigImage.rotate(-i);
   bigImage.translate(-IMAGE_SIZE/2, -IMAGE_SIZE/2);
 }
 bigImage.endDraw();
 bigImage.save("BigImage.png");
 exit();
}
Re: Image rotation makes strong aliasing artifacts
Reply #1 - Nov 17th, 2008, 3:11pm
 
Use smooth() to enable anti-aliasing.
Page Index Toggle Pages: 1