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.
-
Volodymyr commented
@Ashutosh Chaturvedi
Not fixed. I haven't changed float 172.34 coordinate or artboard. I've exported this file as File->Export->Export For Screens.
Result was image 105x104, but should be 104x104 as artboard size.Yes, I'm using a beta build 22.0.0.
-
Volodymyr commented
Here is my bug about this problem https://illustrator.uservoice.com/forums/601447-illustrator-bugs/suggestions/30992416-wrong-png-size-if-artboard-coordinates-in-float
-
Volodymyr commented
This is because you artboards or slices coordinates is in float position like 123.45, but you need to set it to 124 for example.
-
Simon commented
When exporting artboards via 'Export for Screens' 1 pixel is added randomly horizontally and/or vertically to the export.
Bug appears in both Windows and macOS.
Last version to not contain the bug was 2015.3