Why Do Bad Exports Happen to Good Designs?

Have you ever made a perfect design in Adobe Illustrator, but the file exported to .jpg or .png at the wrong size?!
In addition to being the wrong size, this problem usually goes hand-in-hand with white pixels on one or two edges of the image that you never put there!
I have put in my time with this problem in my sixteen-plus years with Adobe Illustrator and I’ve got to tell you, that really bites.
This problem is most common - as in, “this happens 100% of the time” - when I am designing Digital Ads for Google.

Why does this happen?

I’m going to be completely honest with you: I have no idea. I can however tell you what the commonalities of this issue are. In other words, I know what causes this problem, but not why these files export with funky, unwanted extra pixels. 
It seems to happen at specific artboard sizes in documents with pixel-based measurements (as opposed to using inches or points or picas as the unit for that file/document).
It seems to happen more in a 72ppi document than it does in a 300ppi document.
This problem also seems to follow the exact same behavior every time: the file exported is 2 pixels taller and 2 pixels wider than the artboard it came from.

Weird. 

And so far, that’s all I know about that: I don’t know what hex (designer pun?)
is responsible for this terrible behavior from my favorite software of all time.

BUT I DO have
good news my friends:
there are a few ways to overcome this problem.

The First Solution

  1. After you’re done designing your Digital Ads in Illustrator, save, but don’t export.

  2. Open your Illustrator document in Adobe Photoshop.

  3. Export to .jpg or .png from Photoshop.

In my experience, doing it this way yields the desired result every time.
It sounds like this should be my favorite solution, but it’s not.

The Second Solution

  1. Export your file(s) from Illustrator without fear, even though you’re pretty sure this problem will rear it’s ugly head.

  2. Remember that you’re not allowed to export with fear.

  3. Open your janky export(s) in Adobe Photoshop.

  4. Crop.

  5. Save & Close.

This seems like more work, and you’d be right, except that I made an action for this because I have to do it all the time on the exact same sizes for Display Ads on Google.
If you want to use that Action, let me know and I’ll upload it back here!

The Third Solution

  1. Do all of the designs directly from a .psd file in Photoshop.

There aren’t other steps for this one. It sounds like it’s the easiest solution, but in my subjective opinion - which I believe to also be objective truth - Adobe Photoshop is the wrong tool for Graphic Design.

“What, I love Photoshop; How could you say such a thing?!”

Oh, I know I just lit a match dangerously close to the powder, but remember how I’ve been using the Adobe Creative Suite since 2004? You may disagree with me, and I might even be wrong, but I have spent a ridiculous amount of time on this topic and in both of these programs, and if I’m going down, I’m going down swinging! 

I’ll write about that in my next blog: it will be called “You’re Using Photoshop Wrong: What Sets Illustrator and Photoshop Apart.”

Until then, did my fixes work for you? Do you have a problem that you can’t figure out in Illustrator or Photoshop? Do you hate my guts because of the “Photoshop” thing?

UPDATE

I believe that I have actually solved it at it’s source! It came to me the other night, as I was falling asleep: it has to do with the position of the Artboard! If your illustrator canvas is set in any way that it’s position is not exact to a whole pixel, it adds an extra pixel to the dimension of your raster-based export.

The position of artboards are always calculated by the FIRST artboard.
So let’s say that you’re working on a multi-image social media post, and have a series of 1080px by 1080px artboards.
The coordinates of your first artboard are 0px • 0px.

New artboards by default do not overlap previous artboards (although they can be made to, which can be very useful when working with bleeds), so the position of your second artboard will be “1080px + some empty margin space.”
That is when your raster-based exports will begin to suffer: unless you have safeguards like “snap to pixel” in place, your artboard will only have a VERY slim chance of landing perfectly at a whole-pixel distance from the point that your document is set to measure from.

If your second artboard is set 1100.01px away from the origin point on your document (which can happen especially easily when you’re using a different unit of measurement than pixels - say, “inches” - for example), Illustrator will interpret that .01px as a new, WHOLE pixel. Illustrator is using math that allows us to be incredibly precise, far beyond mere pixels, but pixels cannot be subdivided on export: pixels are the smallest unit in any raster-based image.

So how can I avoid this?

  1. Make sure that Window > Artboards is checked, and then on the right side of your screen, you will find the Artboards window. On the right side of the list of artboards, you will see an icon that looks like a dog-eared piece of paper, with two hash-marks at the top left corner.

  2. Click on that icon to pull up a dialog box full of information and settings about that artboard.

  3. On the right side near the top of the dialog, you’ll see X and Y fields, with a box next to it that looks like it’s covered in anchor points. I recommend selecting the top left one. Those faux anchor points define the location on your artboard that the X and Y fields will radiate from.

  4. Since the top left corner of my FIRST 1080 x 1080px canvas is located at Y: 0px, X: 0px, my second one (if you have the top left corner selected) should be at Y: 0px and X: (literally any whole pixel number above 1080px).

  5. Be sure to type the “px” unit in, after the integers in your artboard position, even if your document’s unit of measurement is something else: Illustrator automatically translates whatever unit of measurement you type into any tool to match what it would be in the document unit. So if the document is set to inches at 300ppi, if I type “1100px” into that dialogue, it’ll translate that to “15.2778 in” as soon as I leave that input field.

So, in review: I have 4 artboards that are 1080 x 1080px in a document set in inches, @ 300ppi.
For this review, I have 2 artboards side-by-side, and 3 & 4 are directly below the first two.
I’m gonna set Artboard 2’s coordinates to Y: 0px, X: 1100px because I want a 20px space between my artboards. Artboard 3 will be placed at Y: 1100px, X: 0px, and Artboard 4 will be at Y: 1100px, X: 1100px.

Now, when you export, you have no more pain!

Am I wrong?? If I am, let me know in the comments below!