Skip to main content
Legend
August 3, 2017
Question

The solution to the extra pixel problem

  • August 3, 2017
  • 14 replies
  • 48675 views

Illustrator allows for sub-pixel accuracy in artwork and artboard positioning and sizes. To get a clean, precise export for screens, your artboard needs to be aligned to the pixel grid. This means all its edges need to perfectly line up with the pixel grid.

Sometimes Illustrator, using Export for Screens, exports an image with an extra pixel row or column, and many consider this to be a bug. However, while it is certainly not desirable behaviour, and could benefit from more intelligent handling, there is sound logic behind it.

The root of the problem is when the Artboard Reference Point is set to center. This means the X & Y coordinates are based on the center point of the artboard.

Consequently, when the width or height of your artboard is an odd number, the edges of the artboard are pushed off the pixel grid, and end up in between pixels. Illustrator then tries to compensate for this during export and ends up adding an extra pixel.

Example:

Artboard width: 99 px, X postion: 0

The left edge ends up at -49.5 px because the X position is actually based on the middle point of the artboard, not the left edge, so 99÷2 = 49.5.

The solution:

First, make sure that your artboard X, Y and width and height are all clean, whole numbers.

Then,

A) If your reference point is set to center, compensate by offsetting your X or Y position by 0.5, which will align the left/top edges to the pixel grid.

Alternatively, and preferably,

B) set your artboard reference point to the top left corner and you can then deal with whole numbers instead of messing around with decimals.

Important note about Save for Web (Legacy):

Some people suggest using this to force Illustrator to export at a particular size. Be aware though that if your artboard and/or artwork is not aligned to the pixel grid then Illustrator will export your artwork with blurry edges, because it will try to blend (anti-alias) 2 pixels together. The cleaner and more precise approach is to make sure everything is aligned to the pixel grid and to use the newer Export for Screens dialog.

14 replies

Participant
April 7, 2020

hi,
is this the only way to sort this out? I am seeing sometimes more than one pixel added. I check the size with the info tool and when I export I see one pixel or more...thanks!

ephemeron
Participating Frequently
December 20, 2018

I am running CS6 on a Mac as part of the Adobe Master Collection.

I have made sure the artboard is set to 0.

I have also changed to global rulers.

I've also quit Illustrator and reset its preferences.

Nothing works!

I expect better from purchasing the CS3 & CS6 Master Collection!

Ton Frederiks
Community Expert
Community Expert
December 20, 2018

Please share an example using dropbox , wetransfer ot other sharing method.

And explain what does not work, what and how do you export as what and at what resolution?

busybear10
Participating Frequently
October 31, 2019

I've made sure all of my artboards are set at whole coordinates...now I'm getting proper pixel sizes on 6/8 of my images. Using export for screens, 1x png. 😕😕 

Inspiring
June 3, 2018

Very helpful. Can I ask, how does one align the artboard to the pixel grid? Is it a matter of enabling the artboard tool, setting alignment to the top left corner of the board, then clicking the snap to pixel toggle on the Control Panel? In other words, does one snap an artboard in the same way one snaps objects to the grid?

Monika Gause
Community Expert
Community Expert
June 3, 2018

DougKatz  schrieb

Very helpful. Can I ask, how does one align the artboard to the pixel grid? Is it a matter of enabling the artboard tool, setting alignment to the top left corner of the board, then clicking the snap to pixel toggle on the Control Panel?

Exactly like that. It might be more precise entering the values in the transform panel.

Inspiring
June 3, 2018

Thank you, Monika. I’m so stupid about web and mobile graphics… surprised I had it right. I also didn’t know the transform panel was even available with the artboard tool active. So an Illustrator artboard really is just another vector object in many ways, eh?

Srishti Bali
Community Manager
Community Manager
August 7, 2017

Hi eikonoklastes,

Thanks for sharing this.

Regards

Srishti

BGBenevolent
Participant
June 3, 2018

This is a bug. I've tried many of the proposed solutions and they don't work consistently.

There are alot of templates that are downloaded with this one extra pixel problem, once the mistake has been made it is very hard to correct, I don't want to run everything I export through a third program to trim the extra pixels. This is very frustrating when you have to submit precise documents. Please fix it.

Legend
June 26, 2018

BGBenevolent  wrote

This is a bug. I've tried many of the proposed solutions and they don't work consistently.

There are alot of templates that are downloaded with this one extra pixel problem, once the mistake has been made it is very hard to correct, I don't want to run everything I export through a third program to trim the extra pixels. This is very frustrating when you have to submit precise documents. Please fix it.

It is not a bug. You can 100% guarantee a clean export by following the steps in my original post, which is not a proposed solution but a description of how to use the system correctly. The reason I used the word "solution" in the title is to bring people to this post when they Google the issue.

The system could definitely use improvement to make the user more aware of what's happening, or to be more aggressive in preventing this clearly unwanted issue.