Why the image size increases after exporting to png?

Post questions on how to use or achieve an effect in Inkscape.
anunja
Posts: 2
Joined: Wed Feb 21, 2018 10:48 pm

Why the image size increases after exporting to png?

Postby anunja » Wed Feb 21, 2018 11:14 pm

Hello!
I'm the beginner and i can't understand the thing. I draw the picture (black marker on the paper), than scan it and process a little in GIMP, save to JPG and import in Inkscape. After I traced the bitmap, deleted object with original image from the file and exported the file to PNG I get the image of bigger size in px! Why does it happen????
For ex, original JPG was 2240x528px transformed into the PNG - 5654x1169px without any resizing.
The exporting resolution is 300 dpi.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Why the image size increases after exporting to png?

Postby Moini » Thu Feb 22, 2018 7:06 am

And the importing resolution can be set in the preferences. When they are the same, the image size shouldn't change, as far as I can think.
Edit > Preferences > Bitmaps.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

anunja
Posts: 2
Joined: Wed Feb 21, 2018 10:48 pm

Re: Why the image size increases after exporting to png?

Postby anunja » Thu Feb 22, 2018 3:54 pm

Thanks!
Now I understand what happens in Inkscape and I'm confused with my first step: I make scan with the max resolution 300 dpi but when I open the file by GIMP I see 72dpi in Image size... And the GIMP image size in px doesn't change when I change resolution to 300 or even to 600.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Why the image size increases after exporting to png?

Postby Lazur » Thu Feb 22, 2018 4:59 pm

Hi.

Dpi=dot per inch=made up value on a real world unit=density of virtual building blocks in a physical distance.
Photograph are said to be printed at 600 dpi ->scanning may need/would be preferably of a higher resolution than 300 dpi unless it's a simple textbook for example. Result is an image defined by pixels=for editing resolution has no meaning.
Computer screens won't display your scanned in image at the given real world size, since they have a hard-wired resolution you cannot change.
May simulate another density but it's the size of the screen and the size of the leds building up the screen that is fixed -on a laptop that's around 100 dpi.

By default gimp and most other raster editors work in a 72 dpi model. Not that it would matter any bit, as it only tells what physical units to assign to the exact same px size.
Changing that to 300 won't increase the px size, only assign a much smaller real world unit to the same canvas size.
This dpi data only tells which size to stretch those pixels *when printed*.

Eventually it also tells inkscape what real world unit to assign your imported raster image with.
Current inkscape works in 96 dpi. Meaning, if you want something to look as on screen at 100% zoom level, it needs to be exported at 96 dpi.

If your raster image with 300 dpi is pulled in right, same applies to it -when exported at 300 dpi, it should be of the same px size as it was when imported in. No need for further scaling.
However if the dpi data wasn't kept upon saving in gimp, it'd be pulled in at 96 dpi and you'd need to scale down it inside inkscape by 96/300=32%
to make it possible exporting at 300 dpi to result in the desired px size 300 dpi resolution.


BUT
all calculation is unnecessary if you print from a pdf.
Set up the page size in inkscape to the exact size of choice by physical units and pull in images at any resolution, scaling them to their planned real world measures in inkscape.


On a side note there are plenty of topics discussing the resolution/dpi/handling of printing&pixels here. If you dig down, you'll find very similar answers, some with better explanations.

User avatar
shawnhcorey
Posts: 149
Joined: Mon Jan 07, 2008 12:17 pm

Re: Why the image size increases after exporting to png?

Postby shawnhcorey » Thu Feb 22, 2018 10:28 pm

Pixels are abstract and have no fixed physical size. Dpi only has meaning if the device has fix physical dimension, like printers or scanners. Monitors come in a variety of sizes and resolutions, which means they have no fixed size. And finally, pixels are not dpi. Thinking there are will cause confusion.


Return to “Help with using Inkscape”