Pixel number inconsistency
Windows 10? (most recent and just updated yesterday)
Illustrator 22.1 (64bit)
When I told Illustrator to create an artboard of 350x350 pixels, I thought it could actually do so. That was the template image size that our web designer propogated across our entire website.
Then I exported 11 images from Illustrator to .png format to re-build one of our webpages. They came out as 1459x1459. Now I will resize them in Microsoft Paint. They'll pixelate and probably look like trash. All because Illustrator can't understand "350 pixels x 350 pixels" on the Create New prompt window.
Flaming dumpster fire. I am inexpressibly frustrated that I have to pay you over $400 annually for a flaming dumpster fire of a product.
The intended way to ensure your pixel-sized document stays the same size after export is to use the default screen resolution — 72 PPI.
If you set anything else, Illustrator will scale the image accordingly (as if the 'Resample' option in Photoshop is ticked when you resize an image).
There is no way to write a custom resolution AND maintain the desired size at the same time.
The reasoning behind this behaviour is that the resolution value is supposed irrelevant when an image’s intent is Screen or Web. An image can have no resolution value stored in it at all, it’s just an optional coefficient, and then different viewers and editors suppose a value on their own — usually 72 PPI (Mac-style) or 96 PPI (Windows-style).
Unlike other editors, Illustrator has a continuous range for all measurements units. One pixel is considered to be equal one point, and a point is 1/72 of an inch (in PostScript tradition), and inch is exactly 2.54 mm. This continuity allows to mix digital and print media assets.
TLDR
If you design in pixels and export images for screen intent — use 72 PPI.
If you design for print and export images in inches or millimeters or other real-world units — use any other resolution.
However, comments about this are welcome. World changes constantly, and the once obvious solution might not be clear for new generations. Please share your thoughts.
-
If you have problems with extra pixels being added to your images on export, you should refer to this bug report: https://illustrator.uservoice.com/forums/601447/suggestions/37694659
-
Dridd commented
I keep hearing the comment that one should export at 72 px.
That might be a workaround for some documents, but it still is not a real fix. Especially since it in random cases does not work.When a document is set up in pixels to begin with (typically because of an outside requirement), the export pixels/inch should be completely irrelevant. The export pixel size should be exactly what asked for. Nothing more, nothing less.
It is illogical to suddenly multiply by goofy factors depending on a pixels/inch setting thats irrelevant..
If I created a document in a fixed pixel size, it is because it is what I want.When documents are created in points/inches/feet or other measurements, having them recalculated to pixels upon export to raster is both necessary and logical. But when a document is set up in pixels to begin with, not so.
Especially, since the typical Illustrator miscalculation on export adds an uneven pixels even on 72 pixels/inch (typically rounded to exactly one pixel in one direction or more). When I very specifically asked for for example a 5000x5000 pixel document, an export ending up being 5001x5000 frequently makes the document unusable.
It is very irritating for documents to be rejected as "too large" by a vendor's upload mechanism because of that extra pixel (added by illustrator as a line of white pixels), which I not only did not ask for but is clearly a faulty calculation.So, to me it seems simple. When a document is already perfectly prepared to be exported to raster by setting it up in pixels, just export it as exactly that. Pixels/inch recalculations are in that case irrelevant, since I never asked for a document specified in inches or any other physical size measurement..
-
Eric, Jared, you probably used 300ppi while exporting, instead of 72ppi. It gives you larger image size: 300/72=4.16(6), and 350×4.16(6)=1458.3(3) — rounded up it gives you your 1459.
So when exporting images for screens, use 72ppi.
Does it solve your issue? -
Doug Roberts commented
For any future readers: this is the result you would get if you export a 100 px file at 300 PPI.
If you want a specific pixel dimension, export at 72 PPI.
If you want a specific physical dimension or other PPI setting, create a document using physical units, not pixels.
-
Dridd commented
Export As, selecting to export Artboards.
The resulting PNG files seem to have some random dimensions that are completely unusable.
When exporting a doc with 4 artboards of same size, it at first seemed like it was using the total document size (plus some random amount), because the output PNG dimensions were approximately the size of all the combined artboards, plus a seemingly random amount in each direction.
But for testing, I then added an extra tiny artboard of exactly 100 x 100 px, and after that all the original artboards came out exactly the same sizes as before, while the new test board (at 100x100 px) came out as goofy as 417x418 px.
It seems that the "Export As" gets its wanted output size calculations in some random way, then upsizes each artboard's artwork to that size, which is then exported. Because the individual artworks are correct, but the sizes are totally wrong.
What I would expect, when selecting to export artboards is that each artboard is exported as exactly the size of the artboard. No more, no less.
Similar to what the "Export for Screens" does.In addition, when testing by "Export As" with the whole document (not selecting "Use Artboards"), I instead get an error message: "The operation cannot complete because of an unknown error. [!now]".