The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Pixel exact export...? Thread Tools Search this Thread Display Modes
I am trying to create icons to use in another application. So i create a new drawing, set the measurement tools to pixels, create a 40x40 rectangle, e.g, export it with a transparent background, and open the exported PNG in another program. It is not 40x40, but the canvas itself is. But there are a few pixel of transparency around the rectangle, shrinking it down to 35x36 etc.

I went through the options, but can't seem to find anything that effects this. That must be something braindead simple, so what am I missing?

Tia

Frank
 
Even though you're exporting to PNG the software is considering paper with non printable margins. I got round this by setting up some custom "paper" with no margins especially for exporting PNGs to.

Go to File --->Page Setup...

and choose Manage Custom Sizes... under Paper Size.
 
I tried that. I created a custom paper (20x20cm) with no margins at all. I then create a 200x100pt wide rectangle. I export this, with transparent background, and open the file up in Pixelmator.

The canvas size is: 212 x 108 (which is not even the correct aspect ratio anymore) and there is an transparent border around the rectangle.

This is quite frustrating. I thought about using Omnigraffle as the production tool for iPhone icons etc, but it seems to be impossible to do pixel exact exports with this.

Frank
 
What do you have selected in the "Export Area" pop-up?

From a few minutes of fiddling around, it looks like "Current Selection and "All Objects" will defer to the shape size when exporting. If a shape is larger than the canvas, those extra pixels get exported.

Also, keep in mind that a stroke on a shape is centered on the border of the shape. If you really pump the stroke width on a shape, you can see how the stroke may cause the exported png to be larger than the size of the shape.

In case it helps: if you choose "Current Canvas" (or "Entire Document", I suppose, in a 1-canvas document) the app will clip the export right at the canvas.
 
I export the shape ,by exporting the current selection. I send a test document to support, because, even taking the stroke width into account, it makes no sense a all. Example:

create a document, put a rectangle with a 1px stroke on the document. Make the rectangle 200x100 pixel wide. Select this rectangle. Export it. The exported png has 212x108 in dimension.

I then create a 300x300 pixel canvas. Put a rectangle in it, one pixel stroke, make it the full size. Export the whole canvas. Canvas size is 312x312. And, it's not even a rectangle, because the stroke is not visible in the export. It's just a big transparent blob.

Frank
 
I had trouble getting measurements in pixels working so I set up, for example, a 2 inch by 2 inch canvas and export to PNG at 32 dots per inch. Result: A 64 x 64 pixel PNG. (I verified this 2 minutes ago).

There's a problem though with stroking a full size rectangle on such a canvas, because the stroke is centred on the rectangle sides leaving half the stroke width off the canvas.
 
So presumably then if you give it a 2 pixel stroke, the exported version of the rectangle would have the 1 pixel stroke you really wanted?
 
Yes. But the trouble is, any on-grid 1-pixel strokes in the drawing interior will be half a pixel offset from it, and half a pixel "off" from the rendered pixel grid.
 
My canvas is set up so that 1pt = 1px. Ruler units are pixels.

I have a 50x50px object with a 1pt stroke. 0 corner radius, square lines, mitered corners, no shadow.

When I select the object and export the current selection as a png with no margin, I get a 54x54px image.

This has to be a bug. Has anyone found a work-around?
Attached Images
 
 
Brad, it sounds like you're encountering a combination of the issues discussed in the thread. The shape is 50 by 50, but the stroke is centered on the border of the shape. The 1-pixel stroke is a half-pixel inside and a half-pixel outside the border of the shape. OmniGraffle then does sub-pixel blending to produce what you see on screen. Those blended pixels are going to to make your stroked shape slightly larger.

Since you have "current selection" selected as your export type, OmniGraffle defers to that sub-pixel blending and exports the extra pixels. If you size the canvas at 50*50 and switch to the "Current Canvas" export type, OmniGraffle will instead clip the shape at the canvas borders and omit the extra pixels. Does that help?

Last edited by Brian; 2010-11-17 at 03:31 PM.. Reason: "them" -> "the extra pixels"
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jerky scrolling if granularity other than Exact abarua OmniPlan for iPad 1 2012-07-03 03:59 AM
Export Objects Ends Up With Different Pixel Size agroisman OmniGraffle General 2 2012-03-28 10:02 AM
how to have exact effort durations? it keeps changing them. mlevin777 OmniPlan General 1 2010-11-30 10:33 AM
Searching for exact estimated time BevvyB OmniFocus 1 for Mac 1 2009-04-02 03:18 PM
Exact steps for using Clip feature braintoniq OmniFocus 1 for Mac 10 2007-12-09 11:30 PM


All times are GMT -8. The time now is 01:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.