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.
-
Anonymous commented
I've just noticed the same in photoshop. Trying to same templates in CC Libraries and every template has an extra pixel in width...Seems like a small issue but it's driving me mad :)
-
Anonymous commented
Oh man, would love to see a fix for this!
-
Jotham commented
Just installed the 23.0.3 update and the bug is still there. I've been waiting and stuck with version 2015.3 for this to be fixed. @Ashutosh Chaturvedi Do you have any update on this?
-
Morgan Thomas commented
I have had luck with Sharon Dean's method! Make sure your artboards are aligned to the pixel. I usually just copy and paste art boards over and over because it's my process, but whenever I want to export them, I make sure where they are in the document isn't on a decimal pixel.
-
Dana commented
I've had the same issue, and came here to see if there was a solution that didn't involve opening the file in photoshop to shave off a pixel. As a hail-Mary, I tried the legacy "Save for Web" and it exported correctly. Must be something with the new(er) export functions.
-
Morgan Thomas commented
I have the same issues! I will probably be more aware of where I place my artboards, but it's so annoying. I should be able to copy as many artboards as I want and get the same size. I am at the point where I send all of my .ai files to another designer to export out because it's so tedious for me to shave off 1 pixel in photoshop.
-
Ben commented
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!!!!!
-
Russ commented
This may not be the solution you are looking for, but this can be solved (in both Illustrator and PS) by cropping the unwanted "rim".
-
Jotham commented
Sharon,
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. -
Charles commented
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.
-
Jotham commented
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.
-
Charles commented
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.
-
yasuhiro matsuzoe commented
If 107 px is specified for vertical width and horizontal width in the export of artboard, it will be exported at 108 px.
-
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.
-
Adope commented
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 -
Anonymous commented
This is wasting so much of my time, and I have the board positioned at integers! Please fix this!
-
Victoria Kulieva commented
Hi everyone.
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 -4615pxYet 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?