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
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.
-
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. -
K-O commented
When images are exported via Export for Screens, a white anti-aliased line edge border is created, added to the art. This does not occur under the legacy export. This is visible when the artwork has a flood of color, is solid color.
This is a bug. It's an undesired action. 0% of users want or benefit from the action as-is. Please fix it.
-
Captain Digital commented
When I export a file to a bitmap format [could be Export -> Export for Screens, Export -> Export As... or Save for Web (Legacy)...] Illustrator adds a white row and/or column of pixels to the exported size. In other words, if your artboard is set to 250 x 75 pixels, Illustrator will export the bitmap as 250 x 76, or sometimes 251 x 76. I suspect this has something to do with how you are saving the file's size/aspect ratio internally. Shouldn't matter if I have the file configured for inches, pixels, points or anything else - when I tell Illustrator to export something 250 x 75, I expect to get 250 x 75px, and NOT 250 x 76. This is particularly galling when preparing graphics for website layouts. an extra white row or column of white pixels means I have to pull in every graphic into Photoshop, to lop off the extra row and/or column.
BTW - the only way I can successfully export a transparent PNG now is to export screens (artboards). It will ***** up the size (adding pixels), but at least the background will be transparent. All other export methods result in a solid white background.
-
A separate report was made about a similar problem but for assets:
https://illustrator.uservoice.com/forums/601447/suggestions/48077885 -
Ana Mitrovic commented
This has been a problem for years and it's infuriating. When exporting artboards illustrator will often add a pixel or two to the dimension, even no bleed has been configured. Say your artboard is 128x128px; illustrator exports 129x129px.
This is the only workaround I found and I can't believe more people haven't noticed: https://logosbynick.com/illustrator-exports-1-pixel-more/
I truly can't believe this is the only solution. -
Ton commented
To Dridd,
I totally agree, this should be fixed, I was just trying to describe how to avoid it. -
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.