Imported SVG appears too small in Draft mode

Hi everyone,

I’m encountering a scaling issue when importing SVG images into the Draft mode and am wondering if anyone else has run into this or knows a definitive fix.

I exported an SVG file from Seamly2D. When I open it up in Inkscape, the dimensions look exactly as they should be. However, when I import that same SVG into Draft mode, the image appears smaller than it’s supposed to be.

Interestingly, if I export the file from Seamly2D as a PNG and import that into Draft mode instead, the image scale matches my drafted lines perfectly.

Any insights would be greatly appreciated!

Hi @yumei1001

You did not specify from which mode you exported the SVG from? Was it Draft, Piece, or Layout mode?

I tried it with a layout svg I have. The file had been edited in Inkscape. It was smaller than the draft. Looking at the svg in my text editor, I see that it’s supposed to be 14" by 8.5", & remember that I was printing it to Legal size paper. It’s a doll-size layout. Setting the size to 14" by 8.5" in the Image Properties dialog gets it fitting at 106.67 magnification.

In Devuan (Chimera) Linux, as I usually am. The file was last modified in Inkscape on 2026.03.11

I did not have a parity PNG to play with.

:unicorn:

OK… I played a little bit while watching football… I made a 4in x 4in square, made piece with no SA, and exported it to SVG.

Here’s what it output:

Note that the width and height are 101.865mm close enough to 4in (101.6..). Also note that the path rect in pixel size is 384 x 384… again close enough to 385px x 385px.

image

I then imported the SVG…

clearly smaller by about .94% … scaling to 106.67% (aligning with @Pneumarian) it then fits perfectly:

So that would indicate something amiss in the svg render when importing.

Upon futher investigation:

The mathematical root cause for both the 0.94% shrinkage and the exact 106.67% scale correction factor comes down to a hardcoded conflict between two industry-standard density constants: 96 DPI vs. 90 DPI.

When you export your pattern, Seamly2D targets 96 DPI for its physical-to-pixel conversions:

  • 4 inches × 96 pixels/inch = 384 pixels.
  • Look closely at your <path d="..." /> coordinates: M30,40 to L414,40.
  • 414 - 30 = 384 exactly. The path data itself is a perfect 4-inch square.

However, when you re-import it, the underlying Qt SVG parser or the layout loader is misinterpreting the viewport density as 90 DPI (which was the historical standard for legacy systems and old Inkscape formats)

The fix - force Exports and Imports to use 96 DPI.

Import:

QSvgRenderer* renderer = new QSvgRenderer(svgFilePath);

// Force the system framework to map millimeters cleanly to the 96 DPI pixel space
int targetDpi = 96;
qreal mmToPixels = targetDpi / 25.4; 

and Export:

// Change the header rendering calculation from an arbitrary float to an explicit integer step 
int totalPixelsW = qRound(widthInInches \* 96);  // 384
double exactMm = (totalPixelsW / 96.0) \* 25.4;  // 101.6mm