Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
As of Feb 27, 2024 - the solution is "Rearrange All Artboards" as stated by Mem113.
This does indeed work on multiple artboards.
Copy link to clipboard
Copied
If anyone is coming across this post looking for a solution to asset or artboard exports being off by 1 pixel, Adobe is looking into the issue.
You can vote for a feature request to fix this issue here:
And you can vote for a bug fix to this issue here:
Copy link to clipboard
Copied
A simple 'Align artboard to pixel' option would fix this.... They'll add it in 5 years.
Copy link to clipboard
Copied
@social_Canvas5FEA schrieb:
A simple 'Align artboard to pixel' option would fix this.... They'll add it in 5 years.
It already exists.
In artboard mode there are two buttons to the right side of the control bar. One of them is align artboard to pixels.