The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   Pixel exact export...? (http://forums.omnigroup.com/showthread.php?t=18719)

fmantek 2010-10-27 04:46 AM

Pixel exact export...?
 
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

xooorx 2010-10-27 09:16 AM

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.

fmantek 2010-10-28 01:59 AM

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

Brian 2010-10-28 03:42 PM

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 [I]centered[/I] 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.

fmantek 2010-10-29 04:40 AM

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

xooorx 2010-10-29 06:22 AM

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.

xiamenese 2010-10-29 08:32 AM

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?

xooorx 2010-10-29 10:29 AM

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.

bradlau 2010-11-16 04:42 PM

Yet another person with this problem
 
1 Attachment(s)
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?

Brian 2010-11-17 03:26 PM

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 [I]centered[/I] 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?


All times are GMT -8. The time now is 08:27 PM.

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