Skip to content

Feature Request: Make DPI metadata output independent from export resolution scale

Steps to reproduce:

  1. Open Inkscape.
  2. Create a 900px by 900px page and populate it with some type of image.
  3. Export the page at the default DPI (96) to a resolution of 900x900 pixels.
  4. Change the export resolution to 1800x1800. Then change the DPI back to 96 DPI. Export the page to PNG.
  5. Change the DPI to 300. Then change the export resolution to 900x900. Export the page to PNG.

What happened?

In step 4, the export view will show a change of the export resolution back to 900x900 when the DPI is changed to 96. The exported resolution will be 900x900, instead of the desired 1800x1800. The metadata in the resulting image will show Pixels Per Meter set to approximately 3779.527584‬ (which corresponds to 96 DPI), which is correct.

In step 5, the exported image will be 900x900, which is correct. However, the resulting image will contain metadata with Pixels Per Meter set to approximately 3779.527584‬ (which corresponds to 96 DPI), rather than 11811.0237 (which corresponds to 300 DPI).

What should have happened?

There needs to be a way to set export resolution and exported DPI independent of one another. If there was, then...

In step 4, I would have been able to export an 1800x1800 pixel image with embedded metadata of 3779.527584‬ pixels per meter (96 DPI). In step 5, I would have been able to export a 900x900 pixel image with embedded metadata of 11811.0237 pixels per meter (300 DPI)

Example file for reading metadata

The attached image at the bottom of this ticket (05.324.04.png) was exported from Inkscape to a 900x900 resolution at 90 DPI. You can use a site like https://www.get-metadata.com/ to analyze the file's metadata, where it states:

image

Note that this was desired behavior for this case, since 3543 pixels per meter is approx. 90 DPI. However, using the same base SVG file, I'd like to be able to:

  1. Export it at alternate resolutions but still at 90 DPI (i.e. still maintaining the Units, Pixels per Unit X, and Pixels per Unit Y metadata) AND / OR
  2. Export it at the same 900x900 resolution but have the metadata reflect an alternate DPI (like 96 or 300).

05.324.04

Why this matters

Some software applications use Pixels per Unit metadata in order to translate resolution into scale. MS Word does so, for example.

This is functionality supported in programs like Adobe Illustrator, Adobe Photoshop, and Affinity Designer.

A similar process can be seen in this Photoshop article (link), wherein the user is able to uncheck "Resample" in order to export the exact same base image with different DPI metadata (like 300 for prints). While the argument in that linked article is that DPI doesn't matter on the web, it does matter for printed matter, and it should be easy to set without making changes to the export resolution.

Edited by nopunin10did
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information