Imported bitmap is too big, but resolution is 'correct'

Post questions on how to use or achieve an effect in Inkscape.
Agent24
Posts: 4
Joined: Wed Mar 30, 2011 10:56 am

Imported bitmap is too big, but resolution is 'correct'

Postby Agent24 » Mon Oct 20, 2014 6:06 pm

I am using a fresh (just installed tonight) install of Inkscape 0.48.5 on Windows 7 64-bit.
I wish to import a 300dpi scanned image into Inkscape so I can turn it into a vector.

When I import it, it comes up far too big. From what I read here: http://wiki.inkscape.org/wiki/index.php ... nkscape.3F this is normal, and can be corrected by adjusting the size manually.

There is just one problem - the image I import is originally 1263x1572 px, and Inkscape says it is that exact size.
This means I cannot resize it back to its original size, because according to Inkscape, it is already the correct size - when it clearly is not!

Going by the Wiki, the image should be approximately 2946x3667px when I import it (a 233% increase from 90 to 300 dpi upon importing) but while it is visually larger, Inkscape says it is not so.


Have I missed something, or does this sound like a bug?

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Imported bitmap is too big, but resolution is 'correct'

Postby tylerdurden » Mon Oct 20, 2014 10:10 pm

Have no fear, it is ok.

"Resolution" is a ratio. Pixels are absolute.

A 1"x1" image scanned at 300dpi would measure 1x1inches on a screen with 300dpi resolution... it is still 300x300 pixels.
A 1"x1" image scanned at 300dpi would measure 3.333x3.333 inches on a screen with 90dpi resolution... it is still 300x300px.
Inkscape uses 90dpi internally, so in Inkscape the image is 300x300px, but measures 3.333x3.333 inches.
Rez1.jpg
Inkscape page size set to selected object
Rez1.jpg (152.54 KiB) Viewed 3989 times


NB: on latest pre-release build, the import and export resolution can be user defined.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Agent24
Posts: 4
Joined: Wed Mar 30, 2011 10:56 am

Re: Imported bitmap is too big, but resolution is 'correct'

Postby Agent24 » Tue Oct 21, 2014 10:01 am

Maybe you misunderstood or I did not explain well enough.

The image is certainly too big. If I save the file as PDF for example (A4 size) in Inkscape, the image cuts off and covers the whole page. With Illustrator it comes out the right size.

See the attached screenshots of the resulting PDFs viewed at same zoom level for the comparison
Attachments
Inkscape.jpg
Inkscape.jpg (181.35 KiB) Viewed 3965 times
Illustrator.jpg
Illustrator.jpg (126.53 KiB) Viewed 3965 times

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Imported bitmap is too big, but resolution is 'correct'

Postby tylerdurden » Tue Oct 21, 2014 11:50 am

Inkscape works at 90dpi, so I'd set the page to 210mm x 290mm (A4), scale the imported bitmap to 30% using the toolbar and save to pdf with raster rez at 300dpi.

No imported data gets tossed when scaling within Inkscape, so bitmap quality is retained.


edit: corrected scale factor
Last edited by tylerdurden on Tue Oct 21, 2014 9:02 pm, edited 1 time in total.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

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

Re: Imported bitmap is too big, but resolution is 'correct'

Postby Lazur » Tue Oct 21, 2014 8:50 pm

^ +And illustrator works 72 dpi.

Agent24 wrote:I wish to import a 300dpi scanned image into Inkscape so I can turn it into a vector.
- the image I import is originally 1263x1572 px

When I import it, it comes up far too big.


When imported, the rasters are showing up at 90 dpi. An A4 sized image scanned at 300 dpi should appear 333,33% scaled up compared to the default page borders.
To scale it to the page, use 90/300=30% ration.

As far as I know embedded raster images won't get re-rendered by the saving as pdf option and the rasterisation resolution only affects the filters.

Agent24
Posts: 4
Joined: Wed Mar 30, 2011 10:56 am

Re: Imported bitmap is too big, but resolution is 'correct'

Postby Agent24 » Wed Oct 22, 2014 6:22 am

I understand now, but is it just me or is the Wiki article then misleading?

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

Re: Imported bitmap is too big, but resolution is 'correct'

Postby Lazur » Wed Oct 22, 2014 6:57 am

Why do images 'grow' when imported into Inkscape?
There is a limitation in the way Inkscape imports raster/bitmap images (e.g JPEG, PNG, TIFF images): it cannot read the image resolution. Inkscape assumes a 1-to-1 relation at 90dpi, so any imported image with a different resolution will appear to be scaled. For example, an image of resolution 180 dpi, when imported into Inkscape, will appear twice as big (180 = 90 x 2) in absolute units as it is in other programs. Note that this just scales the pixels of the image, but never adds or removes any pixels.
When exporting back to a PNG image, changing the resolution will only resample the image, not resize it. The only way to keep the image at the same size is to scale it inside Inkscape, once it is imported. For this you need to know the size (in pixels, cm, inches,...) of the image you import. Then select it and in the selector's toolbar, click the lock between the width and height fields, select the unit of the image size and enter either the width or height in the appropriate field. When exporting, if you don't want to lose information from your image, use a resolution larger or equal to the resolution of the original image.
Example: Import an image of size 800*600 pixels and resolution 150 dpi. It will appear to be 1333 pixels wide and 1000 pixels high in Inkscape. Select it, click the lock in the selector's toolbar, enter 800 in the width field. Add some stuff on the image. Export the document to PNG with resolution 150 dpi. The exported image will be identical to the original one except for the stuff you added on it.


Can be a bit confusing with the 800/600 px sized image being 1333/1000 pixels @150 dpi.
Photoshop can embed resolution data to raster images and probably can simulate it at it's native 72 dpi space, but in the end it's the pixel number than won't change.
The example 800/600 @ 150 dpi image is surely an image that has 1333/1000 pixels. Only the 150 dpi that would make it "look" 800/600 @ a 90 dpi space.
In other words, if you import a 1333/1000 sized image in inkscape, and scale it down to 800/600, it will "appear" at 150 dpi.
It's theoretical nonetheless, because if you export it at 90 dpi to a png after this scale, it will get resampled and the resolution won't be kept.
But if embedded to a pdf and print it, the 150 dpi will be present -1333 pixels will appear at the desired physical distance (8,886 inch).

On a side note, each screen has a different resolution. For example a screen which is 346 mm=13,622 inch wide, displaying 1366 pixels horizontally means a 100,279 dpi resolution.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Imported bitmap is too big, but resolution is 'correct'

Postby tylerdurden » Wed Oct 22, 2014 10:53 am

The wiki maybe could have been worded better, but it may soon be moot. The .91 pre has a new import dialogue that offers rez recognition. If all goes well, it may appear in the next release.

_91-pre-Import.jpg
_91-pre-Import.jpg (72.66 KiB) Viewed 3897 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

User avatar
ianp5a
Posts: 106
Joined: Thu Sep 02, 2010 1:30 am

Re: Imported bitmap is too big, but resolution is 'correct'

Postby ianp5a » Wed Oct 22, 2014 10:59 pm

Take a look at this other thread where I had DPI problems possibly caused by the raster EXIF data.
viewtopic.php?f=22&t=16809


Return to “Help with using Inkscape”