Wrong exported image size (extra pixel added) if artboard coordinates are non-integer, not pixel-perfect
In attached AI file there are 1 artboard if you just export it for Screens you will get an image size 105px × 104px, however in AI it's sized as 104x104px.
Check that X coordinate of artboard is 172.34 px, so it's float. Just change it to 172px and re-publish and image will be 104x104.
So, coordinates of artboard should affect into output PNG image.
Also, should be related too:
https://illustrator.uservoice.com/forums/601447-illustrator-bugs/suggestions/20530969-export-for-screens-adds-extra-pixels-at-to-exports
AI 21.1.0 macOS
-
Video_2025-01-07_214212.mp4 7263 KB -
Export As.png 2 KB -
Script.png 2 KB -
Export for Screens.png 2 KB -
Asset Export.png 1 KB -
file_differences.gif 150 KB -
Screenshot 2024-05-29 at 12.02.53 PM.png 20 KB -
Screenshot 2024-04-18 at 4.53.13 PM.jpg 459 KB -
FL-MASTER-weblogo WIDTH CORRECTED IN PHOTOSHOP.png 5 KB -
FL-MASTER-weblogo ORIGINAL ILLUSTRATOR OUTPUT.png 4 KB -
FARELANES-logo-menu-Apex.jpg 21 KB -
illustrator bug.jpg 238 KB -
Screen Shot 2021-12-02 at 9.51.52 am.png 1758 KB -
exporting-issue.png 59 KB -
4x5 RATIO chandelier1midnightoncandy.jpg 2283 KB -
2021-06-16 14-20-32.mp4 4208 KB -
illustrator_export_bug_2.png 28 KB -
illustrator_export_bug.png 40 KB -
SD21-000-SittingDuckWebinar-ads-GW-v1.ai 4912 KB -
sample exports.ai 1202 KB -
Screenshot 2020-10-27 at 14.34.35.png 614 KB -
Screenshot 2020-10-27 at 14.34.08.png 677 KB -
Screenshot 2020-10-27 at 14.34.35.png 614 KB -
Screenshot 2020-10-27 at 14.34.08.png 677 KB -
bug_01.gif 109 KB -
artbaord_antialiasing_issue.png 289 KB -
2urn-shot_1226.png 280 KB -
Export wrong size.ai 155 KB -
pixel-preview-vs-export.png 21 KB -
ilbg.png 17 KB -
Illustrator_export_for_screens_bug.jpg 142 KB -
bug.ai 355 KB -
Test_1.jpg 63 KB -
Test.ai 681 KB -
bug.ai 355 KB -
Illustrator_export_for_screens_bug.jpg 142 KB

This issue is probably happening because the artboard dimensions are not appropriate for raster export (i.e. are in decimals).
If you make x and y values as the whole numbers in the transform panel (not in decimal), then the extra pixels will not be added to the exported image.
That is the workaround, and it’s reported that it’s not always the case.
At the same time — Ai knows the size of artboards to be exported and yet it does not deliver the set sizes, which is not fair. The team is going to rethink the algorithm.
-
Dridd commented
To @Ton
While it may or may not be true that you can trick the algorithm currently used to export correctly by messing with rulers, that should be irrelevant.
The size of an artboard is what it is and should export as such.
A 2000x2000 artboard should export as purely 2000x2000, a 5x5 inch artboard exported at 300 pixels/inch should export at 1500x1500 pixels.
Having an artboard export magically change size (have single pixels added) depending on where they happen to be located in the document (x/y coordinates of the upper left corner) is the logical equivalent of saying that the size of your car depends on where you happen to park it.
Also, that artboard location can be changed even by AI itself, simply by clicking the distribute artboards button. Which does NOT change the size of the artboards themselves, only the x/y location of the artboards within the document.
When I set my artboard sizes to clean values (in my case even in clean pixels), then I expect the export to be exactly what I asked for. Not a magic single (and invalid) pixel larger, because the calculation for some odd reason include the artboard location in the calculation of artboard export size.
-
Ton commented
To Dridd
Units should be points or pixels. The rulers need to be global rulers and the artboards x/y coordinates should be measured from a corner (upper left). Artboard Rulers can give the false impression of being aligned to the global pixel grid resulting in additional pixels. -
Dridd commented
To Egor
No, not just happening on float sized art boards.
This happens also on artboard sized in pure/fixed pixel sizes.
That single superfluent pixel gets added even then. Which in cases where you have to upload in a fixed pixel size makes uploads fail.For some odd reason, it seems related more to the location/distribution of artboards in a document.
As if the x/y coordinates of the artboard's document location are influencing the size of the exported artboard.To me it is simple, a 1500x1500 pixel art board should be exported as exactly that.
Not as a goofy and invalid 1500x1501 or 1501x1501 pixels.That single pixel extra causes some severe issues (rejections) with uploader locations that check for required dimensions.
This is a serious flaw that should have been fixed a long time ago. And it should be simple to fix.
BTW. This also has the side-effect, that if you finally have managed to put each artboard in a location that exports correctly, you cannot use AI's "distribute artboards' functionality, as this recalculation of X/Y locations will suddenly invalidate the board locations and some or all of the artboards suddenly get this problem again.
-
Paul James commented
Thanks for replying 6 years down the line. Very Adobe of you!
-
Captain Digital commented
When I export a JPEG (File>Export>Save to Web (Legacy) Illustrator adds a 1-pixel white line to the left edge and bottom edge of the image. I set the page size as 350 x 100 pixels, and when I export, I get a 351 x 101 pixel image. The attached image is an example of the output.
-
June commented
This is a critical issue with Illustrator. Either there is a use-case for artboards on non-integer positions exporting at unspecified sizes, or this is a bug that should have been addressed a long time ago.
Why would someone want their artboard positioned on a non-integer unit? I can imagine some reasons, But in these cases, I'm curious why anyone would be satisfied with Illustrator adding a pixel or two to their export.
Adding Artboard unit snapping or correcting the export math should solve this issue. It would not solve the ultimate paradox of funneling mathematically-infinite artwork into a raster image, but it would lots of people lots of time.
-
D commented
So the solution I found that seems to offer more consistent behaviour is to make sure your artboards are pixel perfectly aligned first. When I first filed this issue, I too was driven by the "developer" requirement need to make icons work - same artwork, all different sizes.
So the dev tip is to make sure that you setup a multi-icon template with all the required sizes as individual artboards that are all pixel perfectly aligned. This is part of the workflow I use to generate all icons for Xcode. Save it as a template.
There is something fundamental in the rounding process where Adobe doesn't change the frame of reference to match each artboard position as they export artboards - they seem to use some global co-ordinate system and re-calcuate the frame size, despite the human actually defining in the artboard dimension. From a software point of view, if it is implemented correctly it should never have hit a rounding error nor change the artboard size defined.
As a developer, I totally re-iterate that it is a serious problem and am surprised that it takes so long for issues to be solved. I filed this 4 years ago. It wastes time. Icons iterate often at various points in the project. I'm fortunate that I drive both Xcode and Illustrator, but it would be more of a pain if somebody keeps sending you 1-pixel out artwork and they can't explain why.
-
Mike Pandolfini commented
This is a serious problem for developers, especially when asking artists to export at power-of-two sizes, which is critical for keeping down app sizes and even processing times with lower-end GPUs. We encounter it in every project where the artist is using Illustrator. It's very easy to miss even when you know about it. Please, Adobe, you have to fix this.
-
Bern Leckie commented
When exporting an artboard set to 512x512 pixels precisely, the resulting PNG file at 1x resolution comes out as 513x512 pixels. (This sounds not too bad, but causes ugly scaling artefacts on import to Wordpress.) I'm using Illustrator 27.5 on MacOS 12.6.5.
EDIT: Silly me, I hadn't found the other comments here (thanks mods for redirecting) - and making the X and Y integer values worked. Obvious development request: could new artboards generated by Ai be given integer coordinates by default? -
Peter Furstenberg commented
Since upgrading to Illustrator 27.2 assets exports at the incorrect size. The exporter adds additional empty pixels around the asset.
1. Create a new document.
2. Create a square exactly 200x200px (Only happens when xy coordinate is not a perfect pixel)
3. Add asset to the Asset Panel
4. ExportThe result for me is a 201x201px asset with an extra pixel to the right and bottom.
Other assets (I've tested) export 213x214 px, 201x211 pxAttached is another asset that completely exports wrong.
(macOS Ventura 13.1 (22C65))
-
Slingshot Design commented
For many reasons I want my images for web to be an exact size.
When I have multiple artboards and use the Export for screens option, most of the time the images that are outputted are a slightly different size to my artboards.
For example if an artboard is 1440 x 690 the image outputted might be 1441 x 691. Or sometimes just one of the dimensions will be wrong like 1440 x 691.
I can get around this for one artboard by double clicking in the corner of the rulers to reset the artboard x & y but any other artboards will still output at the wrong size.
For this reason, Export for screens has been mostly useless for me since it was first introduced and I still have to use Export > Save for web for every artboard.
-
Delos commented
Hi, I have the solution, it's almost this one.
In my side it's about the artboard position (X, Y), must be an integer.So artboard position or dimension, but yes this is annoying.
Thanks. -
Delos commented
Bonjour, exemple:
Une illustration dans un plan de travail qui fait 240px de large.
Si mon plan de travail est par exemple positionné: x:10.458 et y: 5.879
J'exporte en png, mon fichier fera 241px.
Je repositionne mon plan de travail: x:10.00 et y: 6.00
J'exporte à nouveau et mon ficher fera bien 240px.C'est un problème qui existe depuis plusieurs générations, et c'est embêtant quand on fait de la précision pour du web.
Merci. -
This is rubbish. I've been fighting with extra pixels for years. It got better, but these still happen occasionally.
Izabela, can you please share the file which results this (especially 8px!)?
The content is not that important, I believe, just artboards.Put it here in the comments or send it over to sharewithai@adobe.com if you don’t want to do it publicly (then please state the link to this report for better tracking — https://illustrator.uservoice.com/forums/601447/suggestions/45798424)
And please provide the exact steps you are performing: which export method, which settings, etc. Maybe record a video even, or a GIF — this would help developers to jump to this sooner.
Thanks! -
Izabela commented
Illustrator is adding pixels when exporting:
My artboard is pixel perfect, it is positioned well and Illustrator is adding 1 pixel to it's width
Yesterday it added 8pixels to the lenght of a file.
I cropped it off in Photoshop, but it is annoying that it is changing the intended file dimensions when exporting and adding an extra step to the workflow. -
Marcos G commented
Pudiste resolverlo? Tengo el mismo problema
-
Creatividad commented
Google translate: The same thing happens to me, when we have many work tables at different sizes, I add that although the pixels are perfect in the work table, the image exports are either at 1x or 72dpi, most of the cases do not match the size of the table working and there is no way to export exactly the size it should go.
Me pasa lo mismo, cuando tenemos muchas mesas de trabajo a diferentes tamaños, añado que aunque los pixeles sean perfectos en la mesa de trabajo, las exportaciones de imágenes ya sean a 1x o a 72ppp la mayoría de casos no concuerda con el tamaño de la mesa de trabajo y no hay manera de exportar exactamente el tamaña que debe ir.
-
Christian Zagarskas commented
I have a similar problem
Example:
https://youtu.be/irc6URkO3fM
Note - by deleting the decimals from the X/Y coordinates I have been able to resolve the problem, but we should not have to "delete" the decimal places of X/Y coordinates if we have set an exact size -
Christian Zagarskas commented
I have the same problem
Example:
https://youtu.be/irc6URkO3fM
Note - by deleting the decimals from the X/Y coordinates I have been able to resolve the issue but I should not have to do that, and its especially a problem when exporting/rearranging 100's of small artboards with icons and very specific APP development media that needs to be exact sizes.I guess my report here is a duplicate, so I upvoted and added a video here
https://illustrator.uservoice.com/forums/601447-illustrator-desktop-bugs/suggestions/44989069-ai-26-1-artboards-do-not-export-and-proper-size -
Christian Zagarskas commented
Here is a VIDEO proving the problem exists and how to recreate it
https://youtu.be/irc6URkO3fMProblem: when exporting a specific size, lets say 1000x1000 px square 1:1 ratio, Illustrator creates an image that is off by 1px (width/height, or both)
To recreate:
make an artboard that is 1000x1000 pixels, NUDGE the artboard on the screen so the X/Y coordinates begin to use decimal places. Export the artboard, you will see that the greater the offset of the X/Y coordinate the more the deviance of the W/H, up to 1 pixel.This causes problems when using media in applications that have strict settings for sizes.
Expected Behavior:
Irrespective of wherever my artboard is placed on the screen my explicitly set size should be honored/enforced during the export.