Skip to main content
Synthoras
Participating Frequently
October 13, 2020
Answered

FIX IT: Illustrator adding 1 pixel to the exported image

  • October 13, 2020
  • 6 replies
  • 1416 views

Illustrator has this annoying bug where it adds 1 pixel to an exported JPEG or PNG if the artboard it originates from has got a decimal value in its position. This is very frustrating for someone that pays for these programs and requires precision.

 

Is there an easy way to remove the decimals without always having to click on each artboard and check?

 

It is appalling.

Correct answer Ton Frederiks

Double click the intersection of the rulers to set the zero point for the first artboard.

To move all other artboards, choose Rearrange Artboards and give a spacing in points or pixels.

6 replies

Albeitadrift
Inspiring
October 29, 2025

This solution hasn't solved it for me. 
I have had to make another file copy artboards over to a larger canvas (as I couldnt rearrange without them falling off) initially copy paste just yielded a rainbow spinning wheel for 5 seconds then no paste. 
Copying them in blocks of 6 worked. \
However after zeroing artboard 1 (I can see the ruler realign the zero to the corner of artboard 1.
But then rearranging artboards and utilising the pixel/points to 60, then rearranges, but the artboard positions are then still having decimals and when exported still have extra pixel. 
Even the first artboard moves and is no longer 'zero'ed' either. 

mariom93920726
Participating Frequently
February 4, 2025

Made an script ( with help of perplexity) 

Tried it, and it works for me.  Basically  what it does it goes through an document art boards and fixes the decimal pixels ...

 

 

// Get the active document
var doc = app.activeDocument;

// Loop through each artboard
for (var i = 0; i < doc.artboards.length; i++) {
// Set the active artboard
doc.artboards.setActiveArtboardIndex(i);

// Get the current artboard rectangle
var artboardRect = doc.artboards[i].artboardRect;

// Round the coordinates to whole numbers
var newX1 = Math.round(artboardRect[0]);
var newY1 = Math.round(artboardRect[1]);
var newX2 = Math.round(artboardRect[2]);
var newY2 = Math.round(artboardRect[3]);

// Set the new artboard rectangle with whole number coordinates
doc.artboards[i].artboardRect = [newX1, newY1, newX2, newY2];
}

// Now you can proceed to export your artboards using the desired method

 

 

Name it as you wish, save as .jsx and install in Illustrator Script folder

Usage: Run the script on open document with already created set of artboards (File-Scripts)

 

 

Monika Gause
Community Expert
Community Expert
October 13, 2020

Is the artboard aligned to the pixel grid?

Do you resample the artwork when exporting?

Ton Frederiks
Community Expert
Community Expert
October 13, 2020

Also check if the size of the artboards contain fractional pixel values and export at 72 ppi or multiples thereof.

Ton Frederiks
Community Expert
Ton FrederiksCommunity ExpertCorrect answer
Community Expert
October 13, 2020

Double click the intersection of the rulers to set the zero point for the first artboard.

To move all other artboards, choose Rearrange Artboards and give a spacing in points or pixels.

Just Shoot Me
Legend
October 13, 2020

I moved your post over from the poorly named "Using the Community" forum, which is for getting help using this forum system, to a better forum.


I hope this helps. Best of luck to you.