This is Illustrator CS5. I'm trying to export to PNG, but I keep getting a black border on two edges of the final image.

I know the usual issue is the alignment of the object on the artboard but Illustrator refuses to align my object with the artboard correctly. My artboard is set to top left position, x=0 y=0, w=512, h=512.

My object is the same exact size, but if I set it to x=0 y=0 Illustrator moves it back again, to either 0.5px or -0.5px. This obviously causes the bug with the exported PNG. This doesn't work for me with either Export or Save for Web & Devices.

enter image description here

How do I solve this? Is this a bug? Do I need to make the object 1px bigger than the artboard every time, just to get around this?

  • 1
    Do you have it set to Align to Pixel Grid? – JohnB Nov 5 '19 at 20:32
  • @JohnB Yep. If you post as an answer, I can accept. – BadHorsie Nov 5 '19 at 22:51
  • I already mentioned Snap to Pixel in my answer ... – Wolff Nov 5 '19 at 22:59
  • @Wolff Is that the same as Align to Pixel Grid, in the Transform tab? I had to turn it off there. I had no snap options enabled in the View menu. – BadHorsie Nov 5 '19 at 23:02
  • 3
    Does this answer your question? Illustrator CC: Turn off align objects to pixel grid – BadHorsie Jan 2 at 15:23

The only explanation I can come with is related to Snapping, Grids and Rulers.

The unexpected behavior could come from a combination of several things:

  • You have turned on Snap to Grid.
  • You have turned on Snap to Pixel.
  • Your grid has unwanted settings. Check Edit > Preferences > Grid and see if Gridline every and Subdivisions is set to what you want.

  • You have accidentally moved the origin of your document to maybe [-0.5, -0.5]. Move it back to the upper left corner of the artboard by dragging from the intersection of the two axes.

| improve this answer | |
  • I don't have any snap on. I dragged the document origin back to the corner of the artboard. I have noticed that my object will always adjust itself an extra -0.5 on the X axis, and +0.5 on the Y axis, whether I drag it with the mouse, move it with the keyboard arrows, or enter a number myself. So if I tell it to move to 4px it will change the number itself to 3.5. – BadHorsie Nov 5 '19 at 22:42
  • Does this happen with every object? Does it also happen in a new document? – Wolff Nov 5 '19 at 22:53

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.