0

Is it possible to simply open a SVG and save it with different DPI?

Since Illustrator exports with 72 dpi and Inkscape "imports" with 96 dpi, my artworks are rescaled. As I rescale documents manually a lot, I'm hoping there's a more efficient way to do this. I'm not into this matter, but from my knowledge the actual pixel size (from which DPI is derived) of a SVG is small text-tag in the (svg-text-)file. It should be fairly easy for someone crafty to multiply the values via script (although I'd prefer a Inkscape/Illustrator solution).

E.g. If Inkscape opens a DIN A4 sized artwork (210x297 mm) saved as SVG with Illustrator, it will first display the document size in pixels. When I switch to "mm", it will say 157x222 mm, which is 67% of DIN A4. This is just a matter of the assumed DPI.

with 72 dpi, DIN A4 (210x297 mm) = 595 x 841 px      [= 157x222 mm (67% DIN A4) in 96 dpi]
with 96 dpi, DIN A4 (210x297 mm) = 793 x 1122 px              (rounded values)

I thought of this as a different way of fixing the issue of Illstrator saving SVGs natively with 72 dpi and Inkscape opening SVGs natively with 96 dpi (hence millimeter/inch-measurements are scaled by factor 1.3333, which is bad for prints/lasercuts). I already described the problem in my question, whether Illustrator native SVG resolution can be changed.

  • just curious about why do you need to change software! are you getting svgs from other who made it in Illustrator but you don't have illustrator so you're using Inkscape? – Mr.Online Aug 28 at 12:32
  • Why would a A4 have any pixels at all? Anyway make a script to rescale. Inject a group transform before all content etc.. But which end would you prefer to do it in? – joojaa Aug 28 at 16:53
  • @Mr.Online: Our Lasercutter (and Team) works with Inkscape, respectively Inkscape-"DPI" (= 96) whereas our design-team is comfortable with Illustrator. – Honeybear Aug 28 at 18:52
  • @joojaa: E.g. for printing, a printer will need some sort of rasterization, as generally a printer works with a discrete grid. Same applies to other hardware (e.g. monitors or our lasercutter) that create visuals from the mathematical pixel-less vectorworld. That's when simply said, I view A4 in "pixels", "dots" and DPI, which defines the density of those on it's fixed metrical size. What do you mean with "inject group transform" before all content? Is this something I specify in the SVG file itself? Regarding on which end: I'd prefer to get a ready SVG out of Illustrator. – Honeybear Aug 28 at 19:04
  • Being not very firm with SVG (on a textual basis), I just peeked into a file with a text editor. My illustrator file contains <svg ... width="1700.79px" height="850.39px" ... > whereas the "correctly rescaled" Inkscape equivalent says <svg width="600mm" height="300mm" ...>. BOTH files indicate for the first "object" <rect ... width="297.63599" weight="419.52701" /> . So just changing the "head tag" <svg ...> could be enough. – Honeybear Aug 28 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.