Blurry rectangle edges / how to pixel-align?

Post questions on how to use or achieve an effect in Inkscape.
cytrus
Posts: 4
Joined: Mon Jan 23, 2012 2:59 am

Blurry rectangle edges / how to pixel-align?

Postby cytrus » Mon Jan 23, 2012 3:05 am

Hello, I'm testing inkscape for the first time, doing something really simple:
- New document 64x64
- Drawing a rectangle, snap to grid, filling with red color
- Save copy as pdf
- Open pdf at 64x64 display size

The upper and right edges of the rectangle are blurry, it does not seem to align on the device pixels.
However I did snap the rectangle to grid and I am displaying it at 1:1 ratio. If I export to bitmap PNG instead, everything looks good.

Any idea what is the issue here and what can be done about this?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Blurry rectangle edges / how to pixel-align?

Postby brynn » Mon Jan 23, 2012 3:33 pm

Welcome to InkscapeForum!

Does the rectangle display properly while it's still in Inkscape? Is it just the PDF file where the problem occurs? If the PNG export looks fine, and the rectangle looks ok in Inkscape, then I'm guessing it might be how you're viewing the PDF that's the problem. What is the "device"?

cytrus
Posts: 4
Joined: Mon Jan 23, 2012 2:59 am

Re: Blurry rectangle edges / how to pixel-align?

Postby cytrus » Mon Jan 23, 2012 7:29 pm

brynn wrote:Welcome to InkscapeForum!

Does the rectangle display properly while it's still in Inkscape? Is it just the PDF file where the problem occurs? If the PNG export looks fine, and the rectangle looks ok in Inkscape, then I'm guessing it might be how you're viewing the PDF that's the problem. What is the "device"?


The rectangle displays properly while in Inkscape. I've opened the PDF at its actual size in Preview.app (MacOS X) and I'm seeing the blurry edges. I'm also displaying the PDF image inside a software I'm developing at 32x (the image will serve as an icon for a control in the app) and I'm also seeing the blurry edges.

Any idea?

Thanks for your help!

cytrus
Posts: 4
Joined: Mon Jan 23, 2012 2:59 am

Re: Blurry rectangle edges / how to pixel-align?

Postby cytrus » Mon Jan 23, 2012 7:51 pm

I also just tried drawing the PDF image in a test application project in a simple view at 64x64 and the edges are blurry again.
I'm puzzled here :/

dvlierop
Posts: 139
Joined: Sat Sep 08, 2007 4:25 am

Re: Blurry rectangle edges / how to pixel-align?

Postby dvlierop » Tue Jan 24, 2012 10:30 am

What has been aligned to the grid? Is it the edge of the stroke or is it the nodes? In the later case it also depends on the stroke width of your object whether you get crisp lines or not, see this thread http://www.inkscapeforum.com/viewtopic.php?f=14&t=3653

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Blurry rectangle edges / how to pixel-align?

Postby brynn » Tue Jan 24, 2012 11:27 am

Hi Diederik,
I first wondered if the rectangle dimensions are not an integer value, then perhaps only part of the rectangle can be aligned to the pixel grid. So if for example the top left corner was snapped to the grid, and the rectangle height was 3.0 but width was 4.5, then the top, bottom and left sides of the rectangle would be crisp, but the right side would be blurry. (And if the top, right corner was snapped to the grid, then the left side would be blurry.) I'm not sure if this is an accurate understanding?

If it is cytrus, that might indicate the the rectangle dimensions are not integer values. Did you snap the bottom, left corner to the grid?

cytrus
Posts: 4
Joined: Mon Jan 23, 2012 2:59 am

Re: Blurry rectangle edges / how to pixel-align?

Postby cytrus » Tue Jan 24, 2012 11:40 pm

The rectangle has no stroke and all edges are aligned to the grid.

But I have now solved my issue, it turns out that I need to setup my inkscape document to be 64 points in size instead of 64 pixels. Now when I'm drawing my PDF image on screen at 64 pixels it looks great.
This is not really what I would have expected but it does work when doing that :/

Thanks for your help!


Return to “Help with using Inkscape”