0

I am tearing my hair out on this one, albeit I am fairly new to Illustrator I have researched the best way to export art of particular dimensions for the web, and this appears to be the best way. It's worked fantastic in the past, but I am now embarking on resizing this image at a range of different dimensions, and I've noticed the rounded corners are vastly different in size and roundness between all four corners (as per screenshot).

I have been exporting this picture in W+H >100px and it has been keeping symmetry, yet when I resize anywhere from around 65-79 pixels the rounded corners differentiate, how can this be?

It is using the standard Illustrator rounded edges effect of 32 pixels.

Please any Illustrator pro I'm hoping you can shed some light on this matter!

I actually had 'clip to artboard' unticked for the last few tests, and that still didn't help, I've since resized the artboard to the exact 250px the rounded box was created as, and still no luck. So it won't be my box is extending past the artboard, I zoom in and it fits perfectly to the pixel inside.

UPDATE: An export of 57x57 and 100x100 are perfectly symmetrical on all corners! It's the 70's range which skews. Incredibly odd!

enter image description here

3

I think you'll find that your vector on the right vertical is slightly outside the artboard. Look at the position and width of the object (coordinates are in the title bar when selected). You should snap the position to exactly match the edge of the document. You can turn on snapping to grid which will help.

Here is what you have (exaggerated): enter image description here

Note the W value in the title bar. The artboard I used is 125px, but the object width is at 126.667 and the X position is at 63.333, where it should be centered at 62.5 and be 125px wide to align correctly (it is currently sitting to the right of center)

Instead, under the window menu select show grid and turn on snap to grid. (You can adjust grid spacing in the Edit>preferences menu) Now when you make your shape it will snap precisely and aligned to the artboard enter image description here

The reason it is behaving this way with such a small misalignment is because it is rounding to the wrong pixel when you shrink it (1 pixel to the right of where you want it). Generally when you resize an image in any program, it has to calculate where to put the pixels at that new resolution. At an odd size (57px for example, or starting at a decimal value), this calculation is more difficult, resulting in a decimal value which can break the threshold between the pixels you want, and the ones displaying.

This also can cause anti-aliasing (slight blur) between two rows of pixels. It is always good practice to resize to easily dividable sizes (200x200px -> 100x100px -> 50x50px for example), that way the calculations are always result in solid numbers, not decimals (half pixels).

  • I believe my artboard is set at 25x250 and my vector is 250x250. I have now made my artboard 1000x1000 and left my vector and not using 'clip to artboard', it is cropping correctly but still with the rounded edge problem. So with my artboards set so large, I don't think my vector could be outside the artboard now? I could attach the .AI file for you to take a look, if you wanted to. – GONeale May 2 '14 at 13:28
  • But I know what you mean, looking at that image, it really looks like it's simply cropping it a few pixels too early on the right, but even as I said with a 1000x1000 artboard and 'clip to artboard' unselected still has problems. – GONeale May 2 '14 at 13:29
  • @GONeale See updated answer. – John May 2 '14 at 13:48
  • Will investigate further and get back to you. But I'm now as stated not even shrinking my artboard to match. My artbox is much larger than the vector. I have however turned on grid and snapping to 1px increments, that will be a much better start anyway. – GONeale May 3 '14 at 5:18
  • Ok great! Even though to the best of my ability I had everything set as whole numbers (X/Y/W/H), some how with pixel grid and snapping, it's managed to fix it after a bit of moving and resizing again too (i.imgur.com/ywYRoMq.png). Thanks again. – GONeale May 3 '14 at 5:32
1

Just in addition to John's awesome answer (+1), you could try the following:

  1. Is your artboard aligned with the pixel grid? Use the Artboard window to see the artboard properties and if the X,Y,W and H are not exact pixels, correct them. If it is not aligned, it can cause extra anti-aliasing.
  2. Is your shape located at an exact pixel? Use the transform window and check if your shape X,Y,W and H are exact pixels. If not, round them up or down to an exact one.

If these did not help, then my obsessive compulsive pixel picking guidelines in this other answer might help: What software should I use to make crisp game graphics for iOS games?

Confession: I never make the final art the exact size of the artboard for that very reason. I spent too much time figuring out the reason for the extra pixel rows or columns that are caused by anti-aliasing. Now I always make my artboards 2px wider and higher than the actual shape (i.e I keep 1 extra pixel all around). Saves me time, frustration and allows me to meet deadlines.

  • Thanks cockypup, will be taking a read and all suggestions along with John's again. – GONeale May 3 '14 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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