How to deal with "doc.properties" and "export bitmap"

Post questions on how to use or achieve an effect in Inkscape.
deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Mon Aug 22, 2011 9:26 pm

Hi!
I'm drawing with Inkscape and I need some specific and concrete sizes ( in pixels ) for my finished work, which must be in .png.

For example, what I'm doing is, first, going to "document properties" and establish the size of the page ( let's say 80x280 pixels ). Then I draw a gold bar, which is not precisely squared, but a sort of rectangle. I put it in the center and define transparency for the background. But when I "export bitmap" to get a .png file Inkscape gives me different dimensions. In this example something like a 100x276 pixels.
My question is: how can I export the image to a .png file with the exact dimensions I want? When you do your work, what is the way, method to do this right? Sometimes the page is filled with the drawing but sometimes not. And in both cases the size in pixels when I press "export bitmap" is totally different.

Thank you in advance and sorry for my English! :)

PatJr
Posts: 81
Joined: Fri Jul 29, 2011 5:35 am

Re: How to deal with "doc.properties" and "export bitmap"

Postby PatJr » Tue Aug 23, 2011 5:00 am

dunno,
I tried it and I had to set the px size under Bitmap Size to get the 80 x 280 px size bitmap

I would think that this step would not be necessary when you export the Page, guess I need to work with this program more to understand it better.

deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

Re: How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Tue Aug 23, 2011 5:35 am

Well, I guess it's not so easy.... Thank you anyway, but in the meantime I've been searching for answers and I found this in relation to "Export Bitmap"- I must say I totally agree with point 5 when he says "Why can't the units of these measurements be changed?" This option shouldn't be so fixed.

http://wiki.inkscape.org/wiki/index.php ... ort_Bitmap



Regards.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to deal with "doc.properties" and "export bitmap"

Postby brynn » Tue Aug 23, 2011 10:04 am

In the Export Bitmap dialog, there is a Custom option, where you can set your own dimensions, if the Page, Selection, or Drawing options aren't right for you. If you set page dimensions in Doc Props, then export with the Page option, the new PNG file will be the same as what you set in Doc Prop.

If you do that, but don't see your image in the resulting PNG, it's probably because your image is not inside the page borders. Also in Doc Prop, you can enable or disable the page border. If you disable it, you have no idea whether your image is within the border or not. So if you prefer to draw with the border disabled, it's important to use "Resize Page to Content", which moves the page border to exactly fit your image. You can, as of 0.48.0, add margins as well. (In previous versions, it's called "Fit Page to Selection" with no margin options.)

It's always very important to check that the dimensions are what you want, before performing the export. That's because sometimes the options you used the last time are still showing in the dialog, and might not be appropriate for your current needs.

Well, I guess it's not so easy.... Thank you anyway, but in the meantime I've been searching for answers and I found this in relation to "Export Bitmap"- I must say I totally agree with point 5 when he says "Why can't the units of these measurements be changed?" This option shouldn't be so fixed.

http://wiki.inkscape.org/wiki/index.php ... ort_Bitmap

In the Export Area portion of the Export Bitmap dialog, it IS possible to use any units you want. In the Bitmap Size portion of the dialog, I think it must say only "pixels", becase DPI means "dots per inch". And dots on the screen are equal to pixels. It is the bitmap (or raster) size. But as long as you have selected the proper export option, and checked that the dimensions and units are proper for your drawing, and you have used "Resize page to content", the export will be the size you intend, even though it is expressed in pixels. In other words, just because it says "pixels" it doesn't change the size of your export.

(Who is Andrew? Personally, I think the Export Bitmap dialog is fine, except for its name. I would like it to be called Export to Raster Formats, or Export Raster.)

So I hope that clears it up some for you. Let us know if you have further questions :D

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: How to deal with "doc.properties" and "export bitmap"

Postby prkos » Tue Aug 23, 2011 12:02 pm

Inkscape uses 90dpi by default, so make sure you have 90dpi set in the Export Bitmap dialogue and you'll get the PNG in exactly the page pixel size.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

Re: How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Tue Aug 23, 2011 11:31 pm

Hi!
Thanks for your answers. I found a, let's say, solution following your indications and changing some parameters. What I did was:

In a new doc, I set the "doc properties" to fit the page size to a 100x100 px, for example. After drawing, it's time to define the "export bitmap" parameters in the "custom tab". In "export area" I have to set these values: x0 = 0, x1 = 100, y0 = 0, y1 = 100. In the "bitmap size" area I set these values: Width = 100px, Height = 100px. And all this works for me.

Unless there is a better solution, this works fine at the moment. Thanks again and regards. :)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to deal with "doc.properties" and "export bitmap"

Postby brynn » Wed Aug 24, 2011 2:49 pm

If you set the page size to 100 x 100 px, and you use the Page option in the Export Bitmap dialog, what happens?

deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

Re: How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Thu Aug 25, 2011 4:57 am

If you use the Page option in the export bitmap dialog, Inkscape cut the surrounding clear area outside our drawing, making rectangular cut areas at top, bottom, left and right. After this, Inkscape resizes the picture to 100x100 px size. And it will probably appear resizing errors because there are not clear areas around the picture.
We have to use the "custom" option to define the clear area limits.

See it here in case my poor English didn't serve for explaining this ;-)

Image

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to deal with "doc.properties" and "export bitmap"

Postby brynn » Thu Aug 25, 2011 1:46 pm

Hhm....
I was hoping the image would help me understand, but it's not showing up. I retrieved the URL, and tried opening the page, but it says "HTTP 403 Forbidden" and further "The website declined to show this webpage". While I've gotten the 403 Forbidden many times, I've never see the website declines to show page.

But, it sounds like you might be talking about margins. Is the problem that you want margins between the image and the edge of the page? If that's the case, you can do that in Document Properties. Before you click "Resize page to content", click on the tiny +. This opens a few more options, where you can set margins on each of the 4 sides of the page. After setting the margins, click Resize button.

So now, your image has margins, blank space between image and edges of the page. And now when you use the Page option in Export Bitmap, it will include the margins!

After this, Inkscape resizes the picture to 100x100 px size. And it will probably appear resizing errors because there are not clear areas around the picture.

No, there will not be resizing errors. If the page is 100 x 100, and you use the Page option in Export Bitmap, the resulting page WILL BE 100 x 100! But I think my comments above will solve your problem, by creating the margins you seek. I hope they do!

Let me know if that works?

deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

Re: How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Thu Aug 25, 2011 9:06 pm

I'm not talking exactly about margins. I'm not trying to set margins as a main goal here. I mean, the question was that, when drawing a lingot bar, the resulting image was a sort of squared lingot bar, and not a rectangular one ( you know what I mean ). So, my requirements are: the 100x100 px area ( Page ) must stay this way for this example we're talking about, but the drawing ( or bitmap area, if that's correct ) can be whatever size, that's not relevant. The generated png files will be used in a game and the developer needs png files with 100x100 px.

So, the resulting page must be transparent ( the background ) but the image must stay the exact way I drew it ( it seems logical :) ) As the images were all wrong, I managed to make some changes and it happens that the ones I said earlier work fine for me.

In relation to the image I sent in my previous post ( can it be seen? ), what I wanted to show is the problem of "distorted" image, what I've just explained before. Anyway, if there's something more you want to know about this, or if there isn't anything clear so far, please let me know.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to deal with "doc.properties" and "export bitmap"

Postby brynn » Fri Aug 26, 2011 2:33 pm

I'm so sorry, I'm afraid I just don't understand. No, I can't see your image (instead, the red x Image) (as I said, I tried to open the host page, but got the previously mentioned error) Would it be possible to attach the sample image to your next reply? Use the full editor (not Quick Reply) and look below Submit button for Upload Attachment tab, and follow prompts.

deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

Re: How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Tue Aug 30, 2011 2:15 am

Visit this URL to see the image. I've tried it with img but it doesn´t work. Sorry!!

http://twitpic.com/6ap8xo/full

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to deal with "doc.properties" and "export bitmap"

Postby brynn » Tue Aug 30, 2011 12:45 pm

Ok yes, I can see the image!
So the square black border, did you draw that? Or does the Page option actually give a result with a white margin?

If the square black border is something that you've drawn for emphasis, then the result from the Page option actually is just a red square. If that's the case, that means that your drawing is larger than the Inkscape page border. Using 'Resize page to content' in Doc Prop will resolve that issue. If that doesn't resolve the issue, then I would repeat prkos' comment, to make sure your DPI is set at 90.

But if the square black border actually represents the edge of the export, and the export actually displays a white border, then I would have to investigate further.

Well, in any case, I'm glad you found a technique that works for you :D

deliaprilis
Posts: 12
Joined: Tue Aug 09, 2011 8:10 pm

Re: How to deal with "doc.properties" and "export bitmap"

Postby deliaprilis » Wed Aug 31, 2011 5:58 am

That's it. The square black border represents the edge of the export.If you're going to investigate this further good luck and thank you for your answers and patience :D


Return to “Help with using Inkscape”