Wrong png size if artboard coordinates in 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
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
This is still a bug! Yes, rounding the artboards to whole integers does work - if you are working in pixels. However, I'm currently working in mm because I'm designing a business card and it needs to be 88x58mm with a 3mm bleed. Even if I round the artboards to whole integers when working in mm, working from the Top Left of each artboard, it still exports different sizes. Eg. my Illustrator file with seven artboards each of exactly 88x58mm, with the top left corners set at (0,0) (100,0) (200,0) (300,0) etc. outputs some JPG's as 1040x686px and some at 1041x686px.
If I want to position a guide line at exactly 3mm for a bleed I then have to get a calculator and work out the measurement in pixels and set the position in Illustrator by typing in 35.45px
Until they change paper sizes to be in pixels then can I suggest you prioritize Illustrator to work correctly in mm, inches, cm, etc. etc.
There is a weird bug in illustrator that always add or take away a few pixel to the overall dimension of the object when exported. I export my objects in 72ppi and have to use Photoshop to crop it to the correct size. Please fix as this is very annoying. For Example: 1920x1080 will be something like 1923x1081.
I agree with what Andy E. has said. In addition. I can't think of a situation I would actually want an artboard not snapped to an integer.
In our office we have documents with up to a hundred artboards, sometimes more when exporting either screens or assets (this has been somewhat fixed by Asset Export, but not completely) making it tedious to make sure every artboard is aligned with a integer position value.
Another issue is I often make copies of a screen on an artboard by holding alt and dragging a copy of the artboard close by - this has cause many alignment issues in the past from artboard to artboard when exporting a raster file from them.
Andy Engelkemier commented
I agree with you Nitish. Creating any new artboard should default to having their position in whole integers. It should be more difficult to position an artboard in a floating integer. This has caused Many Many problems here.
We have found the only good workaround is to create One artboard with a position with a whole integer. Then create a bunch of Objects with that artboard active and snap to pixel turned on. Then convert those to artboards.
But even still, I think there are some rounding problems with illustrator because we still occasionally have some artboards that we have to adjust later. (when we notice there's actually a misalignment. It may happen more often and we just don't notice).
I can't actually think of a reason Ever to have the artboard's top left corner not be a whole integer. Please force that to a default. Let people change it if required.
We've had many discussions here, cussing at Adobe for this problem. It causes us to have a bad day, so we get more foul. And here I am finally posting about it.
An issue I'm seeing is that the default option for artboard is that the artboard is measured from the center. Well, if your width and height is an odd number of pixels vs an even number of pixels, then wouldn't one of those options cause the edge pixels to be half pixels in terms of the workspace? See how that could be a problem? I feel like there's your rounding issue right there. Artboards should be calculated from corners only, with the default likely being the top left.
Export using any fractional scale or height/width, you will get the expected dimensions. If you have artboard and art both pixel aligned then this problem does not comes up. If you can share your file share at email@example.com so that we can look into and analyze what is wrong in the file.
Thanks & Regards