Wrong exported image size (extra pixel added) if artboard coordinates are non-integer
AI 21.1.0 macOS.
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
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.
-
Angel Neo commented
I've always exported my files in 72ppi for web/online files but recently my files don't save at the exact dimensions? They've been exporting as an addition of 1px. For example my artboard is 810× 1440px but it exports 811 × 1441px?
I'm not sure wether it's a bug or I have the wrong settings and for now I've been making my artboards 1px lesser to save my files:( -
Stephan Mönninghoff commented
Please make sure the "Rearrange Artboards" command does not mess up the position of artbords, with artboards ending up four decimal places off the pixel grid. Rearranging artboards should be safe, particularly, if the "Align Art to Pixel Grid" preference is ON!
-
Ruud van den Berg commented
Thanks, Egor. You solved my issue. I furthermore export using the artboard.
-
Ruud van den Berg commented
Thanks, Egor. Please merge, I do not mind at all.
Have a nice Sunday, Ruud
-
Ruud, instead of using the final sizes of the artboards specified, Illustrator calculates these based on their coordinates on the global document grid.
if you pick the Artboard tool and check the X/Y values in the Control or Properties panel, you'll see that the artboard is not placed exactly one the grid — like the attached coordianates_fractions.png shows.
If you change them to be integer, like the second image shows, this file gets exported as 120005 × 9005.This is a known problem, reported here: http://illustrator.uservoice.com/forums/333657/suggestions/30992416
Would you mind me merging your report with this one? -
Ruud van den Berg commented
This is a sample document. When exported, it even becomes a 120006 x 9006 PNG
-
Strange... Would you mind sharing the copy of the file here, please? Remove everything, but keep the layout of artboards.
I am testing this and can’t reproduce, so perhaps it’s file-specific. Needs a close look. -
Ruud van den Berg commented
The artboard is also (exactly) 2880 x 2160 px and properly aligned
-
Can you check the coordinates of the artboards, please? Are these integer numbers, without any fraction?
-
Ruud van den Berg commented
Most of my work is a 2880 x 2160 px (300 dpi) PDF (AI). When I export at 300 ppi/supersampling as PNG it becomes 12001 x 9001 px in stead of 12000 x 9000 px. The additional pixels are transparent.
-
Do not worry. I just wanted to make sure this is the same popular problem reported earlier — it is.
The main reason this happens — fractional coordinates the artboard has. Once you reset rulers, this should get exported fine (although some report it does not help).This explains it, but doesn’t excuse though... and it should be fixed eventually.
As I said before in the comments to this report, Ai knows the final size a user wants, and it should stick to it. -
K-O commented
sorry, for one by one. site wont allow for upload of a zip.
-
K-O commented
export selection jpg
-
K-O commented
artboard export for screens png
-
K-O commented
artboard export for screens jpg
-
K-O commented
ai file
-
K-O commented
Here is the ai and the accompanying exported examples.
Settings: apparent from file and only options available are that antialiasing is on. But, in normal use, aa MUST be on to allow the art to export and look correct.But antialiasing of the edge is making the border. Its seems as though ai, renders the art with white pixels off the artboard/object boundaries and this creates the light border.
To function properly, AI should not antialias the edge.One Correction: I said that legacy export doesnt have this issue, but in this test, it did.
I didnt dive any deeper since I want export for screen to work properly. It needs much more work to be reliable. Currently, for important work, I need to cut and paste assets into photoshop then save for web.Export for screens needs: gif, color profiles, edge fix, rotated photos rendering fix. I think there are already requests on all of these scattered about.
-
Either attach here if you are OK with making it public, or via email: sharewithai@adobe.com (in this case also put the link to this report: http://illustrator.uservoice.com/forums/601447/suggestions/48293624)
-
K-O commented
What method should I use to share?
-
K-O, can you please share both the test file and the exact setting you used to export the image?
The team would need these to replicate the problem.