Inkscape.org
Beginners' Questions How can I export my png file with the correct width and height when I use 90 dpi instead of 96 dpi?
  1. #1
    Johnny51 Johnny51 @Johnny51

    I want to export my drawing in Inkscape as png file but the width and height gets automatically changed when I change the dpi from 96 to 90 in the png export settings. My file is 200x1040px with 96 dpi. How can I export my drawing with 200x1040px and 90 dpi? Should I enlarge my drawing and then export with 90 dpi? If yes, how much should I enlarge my drawing so that the png file would be 200x1040px and 90 dpi?

    I use Inkscape version 0.92. Should I use an older Inkscape version if I want to export my drawings with 90 dpi? I think that the older Inkscape versions exported png files automatically with 90 dpi.

  2. #2
    Tyler Durden Tyler Durden @TylerDurden
    *

    More recent versions of Inkscape have the ability to force DPI to any value.

    I suggest updating to version 1.3.2. https://inkscape.org/release/inkscape-1.3/?latest=1

     

     

     

    Rect1
    Inkscape 20250317093211
  3. #3
    Johnny51 Johnny51 @Johnny51

    Is the ability to force DPI to any value supported in version 1.3.2 and version 1.4? I'm not sure if I should use version 1.3.2 or the newer 1.4.

    https://inkscape.org/release/inkscape-1.4/?latest=1

  4. #4
    Tyler Durden Tyler Durden @TylerDurden
    *

    If you use layers frequently, you might prefer 1.3.2. There is a bug in selecting layers in 1.4. https://gitlab.com/inkscape/inkscape/-/issues/5324

    https://wiki.inkscape.org/wiki/Release_notes/1.3#Release_highlights

    https://wiki.inkscape.org/wiki/Release_notes/1.4#Release_highlights

     

  5. #5
    Johnny51 Johnny51 @Johnny51
    *

    I have installed version 1.3.2 but it's not working when I try to export the selected red rectangle. I have changed pHYs DPI to 90.0 but it still displays 1040x200 96 DPI instead of 1040x200 90 DPI when I want to export the red rectangle.

    What is wrong with my settings?

    Bildschirmfoto 2025 03 18 Um 15.09.07
  6. #6
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Short answer:

    Select your rectangle.
    In the Select tool control bar, lock the padlock icon to preserve aspect ratio.
    Set the rectangle width [W: 1040*96/90]
    Export selection at 90 DPI.

  7. #7
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Longer answer:

    Nothing's wrong with your settings.

    Your rectangle measures 1040 x 200 pixels. Inkscape and SVG treat a pixel as a unit of measure equal to 1/96 inch. Using this default resolution of 96ppi, your rectangle size is 10.833 x 2.083 inch according to Inkscape's Select tool control bar. This yields an exported image size of 10.834 x 2.084 in according to Gimp. Changing the export resolution to 90 DPI generates an output image of 975 x 188 pixels. Gimp reports an image size of 10.834 x 2.089 in. The overall size is preserved with a rounding error.

    As an experiment, I applied a very low resolution of 1 DPI and exported an 11 x 2 pixel image. Opening this in Gimp I see the pixel density is 0.991 px/in or 0.0390 px/mm. It seems that Inkscape exports the pixel density as pixels per mm rounded to 3 decimals.

     

  8. #8
    Tyler Durden Tyler Durden @TylerDurden
    Johnny51

    I have changed pHYs DPI to 90.0 but it still displays 1040x200 96 DPI instead of 1040x200 90 DPI when I want to export the red rectangle.

    Did you export it and open it in another program? The export dialog will not change, but the resulting png should be 90 dpi:

  9. #9
    Tyler Durden Tyler Durden @TylerDurden

    Before proceeding further: I'd reset the preferences, if it hasn't been done after the last installation.

  10. #10
    Johnny51 Johnny51 @Johnny51
    👍

    @Tyler Durden

    I exported the selected rectangle and the png file is 1040x200 px 90 dpi. I thought that it wouldn't work because Inkscape still displayed 96 dpi in the export settings.

     

    Bildschirmfoto 2025 03 19 Um 14.06.39
  11. #11
    Johnny51 Johnny51 @Johnny51

    Do you think that it is possible to see a difference between a png file with 1040x200 px 90 dpi and a png file with 1040x200 px 96 dpi when you would zoom the image?

  12. #12
    Tyler Durden Tyler Durden @TylerDurden

    Hmmmm... they both look bad if you zoom close enough, so... hard to say.

  13. #13
    Paddy_CAD Paddy_CAD @Paddy_CAD
    🏆

    You exported the same source to the same number of pixels in both cases so both images contain the same level of detail. If you display these at their native sizes, 90 dpi will be 11.556 inches wide and 96 dpi will be 10.833 inches wide.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions How can I export my png file with the correct width and height when I use 90 dpi instead of 96 dpi?