Copy link to clipboard
Copied
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.
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Also check if the size of the artboards contain fractional pixel values and export at 72 ppi or multiples thereof.
Copy link to clipboard
Copied
Is the artboard aligned to the pixel grid?
Do you resample the artwork when exporting?
Copy link to clipboard
Copied
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)