Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I am trying to optimise a vector graphic so it does align well to pixels but if I try to align-to-pixel grid I loose too much from the quality and I still need to be able to snap with 0.5px increments.

How can I obtain this behaviour? … without loosing the pixel view feature.

share|improve this question
1  
Why not scale up your artwork to 200% and then every half pixel coordinate becomes a full pixel coordinate. You can then scale back down after. –  Dominic Aug 23 '13 at 13:24
1  
The problem with this is that there is no such thing as a half-pixel. Any fraction of a pixel gets rounded up/down. You will want to choose an alternative unit of measurement. –  Andrew Aug 26 '13 at 19:54
    
@Andrew Finally, a very useful comment, this means that I need to use pt and change the dpi so it will map 1:1, but at least it could be a float. –  sorin Aug 27 '13 at 11:00
add comment

2 Answers

up vote 5 down vote accepted

You can set up a a Grid in the Preferences to have a grid line every .5pt (same as px in AI). Then turn on Snap to Grid in the View Menu. This will allow you to snap to .5px increments. However, it is not going to matter.

While you can place an object at a 1/2 pixel (or 1/2pt in Illustrator), upon output everything is adjusted (anti-aliased) to full pixels. This can be seen by turning on Pixel Preview in the View menu.

For example... a 1/2 pixel square:

half pixel

And with Pixel Preview:

preview

You can see the half pixels are converted to full pixels upon output. Illustrator won't output artwork at half pixels.

Save that half pixel image... open in Photoshop and enlarge 3200%....

enlarged

All half pixels are going to be anti-aliased and treated this way upon output. Any effort you make to construct .5 pixel restrictions is going to be nullified by any output of the file since a single pixel is the smallest screen element.

But you probably are saying to yourself, "I only need some edges to sit on half a pixel. Not a half pixel image."

Well, edges will be anti-aliased to the nearest pixel as well...

edges

(Bottom edge rests on a half pixel. Black edge is a half pixel wide).

And Pixel Preview....

preview

Oh, but let's turn off "Anti-Alias Artwork" in Illustrator preferences and look at Pixel Preview then....

no anti-aliasing

The answer is really not to work at .5 pixels, but to alter the artwork so it looks correct at full pixels.

share|improve this answer
    
Wonderful answer and to your surprise it seems to fit my needs as what I wanted was to pe able to snap the direction points to 0.5 pixels while the anchor points are at full pixels. –  sorin Aug 23 '13 at 11:26
    
Ahh.. snapping handles at 1/2 pixels while anchors are on full pixels makes perfect sense :) –  Scott Aug 23 '13 at 13:46
add comment

Vectors might change the rules a bit in some specific cases, but generally speaking, there is no 0.5px increment. (Unless we're talking CSS px on retina devices, but that's a whole different topic)

A pixel is the smallest unit on a monitor.

enter image description here

In the above image, each set of one red, one green, and one blue light is a single pixel. The device tells the screen how to balance the brightness of those three colors one set (pixel) at a time in order for your eyes to percieve a given color. Your monitor doesn't consider units any smaller than that.


There are some borderline exceptions. Such as a border of a vector shape not perfectly aligning with pixels, so some sort of anti-aliasing occurs. Still not really any half pixel business going on by the time information gets to your monitor though. Also, with ultra HD devices such as modern smart phones, a px in CSS is no longer equal to one pixel. There's still no half a pixel, but on retina (ultra HD) devices, for conversation's sake, you can consider a pixel to be one a half a px is the pixel ratio is 2:1.

share|improve this answer
    
Thanks for the elaborate answer, still I have to say that it does not address my question. While I am fully aware about what a pixel is, I do also know that a vector image has floating point coordinates inside, so you can align them in any way. I guess that the solution is to disable snap-to-pixel and to create a grid that has snap points every 0.5px… this is what I was looking for. –  sorin Aug 22 '13 at 17:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.