# Export off by 1 pixel

I have never found an answer to this. If I create a canvas that is, say, 10 inches x 10 inches, and then export it with a Resolution of 300 dots per inch, the final exported size is 2999 pixels x 2999 pixels. Which is frustrating when I need to export images of a precise size, because it means I need to open everyone in in Photoshop to fix it.

Is there a solution to this? And changing the Ruler Units to pixels is not the solution, because that doesn’t honor Resolution, it assumes you’re operating at 72 dots per inch.

Okay, I think I understand what’s happening. The export resolution is being calculated as follows:

Dimension * (DPI / 72) * 72

So if I have a 10" x 10" canvas, and I’m exporting at a DPI of 72, it is:

10 * (72 / 72) * 72 = 720

If I have a 10" x 10" canvas, and I’m exporting at a DPI of 144, it is:

10 * (144 / 72) * 72 = 1440

But if I have a 10" x 10" canvas, and I’m exporting at a DPI of 300, it is:

10 * (300 / 72) * 72. That should equal 3000. But the (300 / 72) is calculated and truncated, probably to a 3 digits, meaning it becomes:

10 * 4.166 * 72, which is 2999.52.

So what is the solution? If you’re truncating manual, use round() instead. If it’s happening as a result of the language being used, manually use round() instead. Or, best option of all, simplify the calculation so that you don’t do the division. Just do:

Dimension * DPI

But whatever option you pick, please fix this!

Thanks for sharing your experience. OmniGraffle has supports subpixel measurements for precision, but I can see why it isn’t always ideal when exporting. On export it makes sense to round up to the nearest pixel. I was not able to find an easy workaround for exporting the canvas, but I did find a workaround for artboards. If you have any other suggestions for changes or bugs to report, feel free to drop us a line via Contact Omni from your help menu.

In my search for a workaround, I found I can use an artboard and export artboards at 300px to get the 3000px by 3000px measurement. I’ve attached an example if you want to use that as a workaround with these settings:

TenByTen.graffle (6.0 KB)

I’ve tried in the past have been using a batch resize action in PhotoShop or you could also try https://lifehacker.com/batch-resize-images-in-os-x-with-this-automator-script-1773621726 as a workaround.

Thanks,
Lanette

1 Like