Wrong exported image size if artboard coordinates are float
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.
If you will export artboards in any fractional scale or by specifying height and width you will get correct output.
The best way to not get an extra pixel is keep your artboard coordinates in integers. You can achieve that by changing the reference point of artboard to top left and typing in the nearest integer or do Make Pixel Perfect(Object > Make Pixel Perfect). If size of your artboard is increased please manage that accordingly and export.
Thanks & Regards
it's the same when you try to export different icon sizes from 16 to 256 for example. its fkn annoying!!!! pls fix it immidiatley!!!!!
That only works if you aren't scaling images though. Keep everything at 72ppi and it's fine, but try outputting at say 100 or 300ppi and the 1 pixel comes back regardless of art board placement. I showed this in the video I made in the earlier link I posted. This worked in 2015.3 regardless of artboard placement. They can make this work without forcing us to move artboards to exact integers.
Thank you Sharon – I will give that a try and see if it helps :)
Sharon Dean commented
I had the same issue until I made sure my art boards lined up on both X and Y axis on whole pixels (ie: x: 25 not x: 25.22 ) . When one of the axises is a decimal, it will add a pixel when exporting.
Been fighting for this fix since 2015. Last stable build that doesn't have this bug is 2015.3. You can go here https://illustrator.uservoice.com/forums/333657-illustrator-feature-requests/suggestions/30992416-wrong-png-size-if-artboard-coordinates-in-float and vote/read about a workaround that takes FOUR times as long to save the same images as legacy export did. It's still currently under review but probably will not get fixed as it's probably more complicated than just looking back at the code for 2015.3 to see why it worked there and not now.
AI 2019 CC (and all past versions going back to CS3 - that I am aware of):
Here's the bug:
When I export images in Illustrator via "Export for Screens" or the legacy "Export" - my images ALWAYS come out having 1 extra pixel added to their size.
The legacy "Save for Web" is the only export option that doesn't do this, however, there's no way to save multiple images for web - and I'm usually creating a lot of web banners that need to be exported in bulk (usually in a time crunch).
For example, my developers need the dimensions of my image files to be exactly 300x600, and when I export all of my banner ads in Illustrator, they inevitably without fail, will save them as 300x601.
When I downloaded AI 2019 CC, I was very hopeful that this would be fixed, but to my disappointment it is still an issue. I know that this has been a bug for many years and I would love to see this get fixed so that I can go back to creating my web banners on Illustrator without the fear that they'll save at the wrong size.
Susan Lee commented
I am having the same problems on Illustrator CC 2018 on a MacBook Pro on High Sierra version 10.13.6 (17G65). I have tried almost every single option, to no avail. I have a document with 24 artboards representing different google display ad sizes and designs. The artboards are the exact sizes of the images I need (300x300, 728x90, etc.) I have exported them as pngs and jpgs and still had the problem. All are sized with integers, all lined up to top left. I made them pixel perfect and viewed them in pixel preview. Nothing solves the problem. I have been spinning my wheels on this for two days. The elements are sized perfectly too within the artboards. Some of them export okay, but most don't. They are one pixel larger either in width or height or both. Please help! If there's a way to do it, I would love to attach the file to see if you can make it work.
This happens when the coordinates of the drawing areas are float numbers …
Workaround: place the areas at whole numbers (integer), then it seems to work as intended Xb
This is wasting so much of my time, and I have the board positioned at integers! Please fix this!
Victoria Kulieva commented
Just found a solution that works for me. While exporting a file I put ppi in increments of 72.
Let me explain:
- 1 inch = 72px - > 1 px = 0.0138(8) inches BUT Illustrator rounds this off to 0.0139 inches
- ppi - pixels per inch
If my art work is 300x300px and I export it with ppi = 1200 there will be some background calculation from pixels to inches then multiplying by ppi rate:
300 px = 4.1667 inches (Illustrator also rounds it off) - > 4.1667 in * 1200 ppi = 5000.04px
I suppose that because of this fact sometimes I get an 5000x5001 image instead of 5000x5000 one.
So if I put 1224ppi (72px*17) I get 5100x5100 image without additional pixels.
For those who work with inches in Illustrator that's not a problem but if you work with pixels you need to think about that.
Mike Escoffery commented
My Artboards are already perfect integers. No decimals. - 300px by 600px.
And the coordinates of the dartboard itself, is also perfect integers without decimals. - -6998px by -4615px
Yet still when I export, I get 1 pixel added - 300x601.
Now, What I've discovered is that If I move the dartboard coordinates by 1 pixel, it fixes the problem.
I moved the Y coordinate of the artboard to -4614px and it exported fine.
Then for Fun, I moved the dartboard coordinates BACK to -4615px - And it also exported fine.
For some God Awful reason, if I don't physically move all my artboards then its as if illustrator can't figure out that they are already pixel perfect.
This is so stupid. Just fix the bug already. An Image export from an artboard should use the co-ordinates and pixel grid of the artboard anyways. Why should it matter where the dartboard is positioned.
It is so un-intuitive. This should just export correctly and not require all these nitpick workarounds.
Jackie Hurd commented
Rounding everything helps but when I try to export different sizes- 2x, 3x etc. it happens again!!! So the first export after rounding everything to the nearest integer works but that's it. I'm in extra pixel **** and loosing my mind. Why is this an issue when we pay so much for this software?
- Operating System: Windows10, Siri on MacOS
- Steps: File > Export > Export for Screens > Formats: Scale
- Expected results: Icons in DxD pixels
- Actual result: Icons in (D+1)x(D+1) pixels
Cannot export Artboard correctly with multiple scales. The output image files are larger. Some more pixels added without a reason.
Example(ilbg.png): When I try to export my Artboard in 16,24,...,256 px size then the exported pngs are 17,25,...,257 px larger!!!!!
I'm having the same problems as the others here. Even with the artboard being on a whole pixel integer I'm still getting 1 pixel added. I took your advice and made my artboards on the integer. This worked for 12 out of the 13 artboards.
So werid. shouldn't this be built into pixel snapping?
I'm also having this issue, but even with the floats rounded up I'm getting some exports with added pixels. I have an artboard that I duplicate many times, the only thing different in each artboard is the color fill of the paths and layer names, but my collected assets are exporting at different sizes, i.e. some paths are exported at 300x300 as they should be, others 301x300, or 300x301. Again, the only thing different is the color, how does changing red to blue add a pixel? This causes my animations to jump around and it's very annoying, especially with smaller pieces.
…Except that keeping my artboard coordinates in integers has no effect. My artboards are set to whole numbers, and Export As… / Export for Screens is simply not working properly.
I'm still getting A x B+1 dimensions, unless I use "Export for Web".
I am having the same issue - I would think it would be fixed by now?
Having the same issue. Exporting artboards adds "1" extra pixel to the dimension. Very annoying bug!
@Nitish Agarwal Even with the artboard being on a whole pixel integer I'm still getting 1 pixel added if I need to output multiple sizes from the same artboard i.e. 72ppi, 120ppi, 200ppi. 72ppi works correctly but the 120ppi and 200ppi still add the pixel regardless of artboard placement.
As you've mentioned before, if you output from "export for screens" you can manually type in the pixels you want the file (1200, 2000, etc) , but I'm finding it takes FOUR times as long to output this way vs export as (20 seconds vs 5 seconds) which severely slows down workflow as I'm having to do this on 100's of files.
Nitish please have the engineers take a look at this again as it's been nearly 3 years we've been waiting for a fix. Export as works perfectly in version 2015.3 regardless of integer placement so I'm not sure why you guys can't look back to see what the previous engineers did to fix this between 2015.2 and 2015.3 and replicate it?
When exporting artboards in Illustrator I am experiencing a pixel shift in file size exporting to a jpeg
(ie 728x90 banner ad is exporting as 730x92)
File/Export/Export as/jpeg artboard