Svg rescaling dpi

Hello,

Do someone know how to “rescale” svg dpi images without changing dimension ?
I got an image with a dpi of 28486 and I want it to be 100.

I know Fritzing does not care at all, but I do a lot because I need to work in the svg code. For all my other parts (about 80 with variants) I chose 100 dpi, which is great and easy to use.

thanks for your help

While I have never done this to reduce dpi, I often rescale jpg images to be the correct size to make parts (and I assume that will reduce or increase the dpi.) In Inkscape import the image using file->import

then lock height and width to keep the aspect ratio the same and reduce it to the size you want.

if that is now the wrong scale (dpi) then you can change the scale in document properties like this:

you need to lock the height and width and set scale stroke width then you can change the scale (which will change the dpi) and set the size to the height or width that you want the final image to be. I think that may do what you want.

Peter

1 Like

This is on my feature list for a better parts editor. Very often I use scour ( GitHub - scour-project/scour: Scour - An SVG Optimizer / Cleaner ) to clean up SVGs. It can flatten groups with multiple transforms into one if there are no other attributes. It also has some kind of --enable-viewboxing feature, which I did not yet play with.

Aside from this, I sometimes just add an inverse transform to get the scale I want (eg 1mil or 1mm). For example I set the viewbox 0 0 50 30 , width=50mm and height=30mm, then add a group <g transform=scale(0,0254)> around all objects which are in 1/1000inch scale to transform them to mm. I can then work in the preferred scale, while use existing objects as is with the inverse transform. Or recreate them one by one.