So I'm trying to draw a line with Imagick today. Sounds simple enough right?
Here's the code I have:
$image = new Imagick();
$image->newImage(100, 100, 'white');
$image->setImageFormat('png');
$line_color = new ImagickPixel('#555555');
$line_weight = 1;
$line = new ImagickDraw();
$line->setResolution(100, 100);
$line->setStrokeWidth($line_weight);
$line->setStrokeColor($line_color);
$line->line(20, 20, 20, 60);
$image->drawImage($line);
$image->writeImage('test.png');
Nothing surprising, I create a 100x100 white image, I set a line color at 555555, a line weight at 1, I create my ImagickDraw object and tell him to draw a line.
The problem is that the output looks like this: http://i.stack.imgur.com/hM8QS.png
Which looks fine at first, until you zoom in and see this: http://i.stack.imgur.com/O6Yie.png
I tried several settings for the color, the weight and the resolution, but I can't get rid of this weird shadow/blur effect. It does this with pretty much anything I draw (lines, rectangle etc...) except with points. So if I want I can create my single-pixel line with a series of points and a simple for loop, but it will really get tedious to do. Especially since I'm not gonna draw just this single line.
So, anyone has any idea of what is happening? How can I get rid of this behavior?