Page 1 of 1

convert svg to jpg

Posted: Mon Oct 02, 2017 6:16 pm
by Gitte
Hi, I will try my best to explain in english...I am using Inkscape 0.92 on Windows Office 365 Home, cannot seem to find a way to convert a svg file to a jpg file. When I convert to png I loose some of the quality. Anyone knows a better way of converting? tnx

Re: convert svg to jpg

Posted: Mon Oct 02, 2017 11:00 pm
by Moini
It's exactly the other way around: If you convert to jpg, you will lose quality, because jpg introduces artifacts, while png saves all the pixels losslessly.

You can change the dpi setting in the export dialog for png. File -> Export PNG Image -> Image size -> set the dpi value to something of at least 300. 600 is a typical value, too, or 1200 even, in some rare cases.

That said, there is an extension to export to jpg, if you really need it:
https://github.com/giacmir/Inkscape-JPE ... -extension

However, I'd suggest using PNG if what you want is quality.

Re: convert svg to jpg

Posted: Tue Oct 03, 2017 7:24 am
by flamingolady
I agree with Moini that the png retains the better quality (which is why it is a larger file size).

Re exporting size: the larger dpi when exporting gives you a larger file, but not a higher resolution. There have been many debates over that issue. The 300 dpi is what is needed when printing, but when exporting the dpi size would be 96 (used to be 92) in order for the png to end up at the same 100% size that you exported from Inkscape. Now, for me, I have to send large files to my microstock sites, so for me, instead of the usual 96 size, I may need to choose 250 to get a big enough file to sell. So, bottom line, you have choices and need to know what your desired outcome is in order to choose the correct dpi for the png. (hope that makes sense, I'm not the best person in explaining technical things, but you can do a search on these forums and read some really good explanations on the threads....).

Anyway - I use GIMP to get the jpg and it works great; a lot of us use it, as it's open source. Basically I feel it works best to create/export your png, then open the png in GIMP. You then have to chose file/export within GIMP, being sure to change the file extension to a jpg. Also, be sure to click on advanced options, this lets you save a thumbnail, and you can choose to save as the best quality there too. I usually leave the other boxes as is. It will then create a beautiful jpg.

Re: convert svg to jpg

Posted: Tue Oct 03, 2017 1:06 pm
by Moini
The dpi value affects the number of dots per inch in a picture. This /is/ the value for the resolution of a picture. Changing it does not affect the exported PNG image's size in inches, if the program that reads the exported image is working correctly (many aren't, so that may be how you came to this conclusion).
In Gimp, check Image > Image properties to find the dpi value again.

Re: convert svg to jpg

Posted: Thu Oct 05, 2017 9:45 pm
by theozh
Hi @Gitte,
what is your final goal? Do you have a SVG file and want to import it into an MS Word document? Well, then you have to convert the SVG to something which MS Word can import. As @Moini and @flamingolady said, I also would go for PNG with high enough dpi.
As alternative solution: instead of MS Word, you could use LibreOffice Writer which can import SVG directly and you don't have to worry about any conversion and quality loss.

Re: convert svg to jpg

Posted: Fri Oct 06, 2017 8:04 am
by flamingolady
Moini - Maybe there are more technical terms, and I'm unable to explain it well, sorry about that (your explanation is so much better and clear).

There's size and there's 'size', so to speak (in my head anyway). If you hit the Export button, and then look under the Image Size, the size (width and height) DO get bigger when you put in say a 300 dpi, vs the 96.

It would help to know what the anticipated desired outcome is, whether it needs to be printed, or just viewed on a screen, etc. I am hoping that one day Inkscape will be able to convert JPGs so we won't have to export it. But that's after my wish for Inkscape's thumbnails to show a real preview of the drawing, lol.

Re: convert svg to jpg

Posted: Fri Oct 06, 2017 10:52 am
by Moini
Yes, the number of pixels increases with the dpi value. The number of inches does not. The number of kilobytes usually does. Inkscape can convert to JPG, if you use the correct extension: https://github.com/giacmir/Inkscape-JPE ... -extension

Re: convert svg to jpg

Posted: Sat Oct 07, 2017 5:02 am
by flamingolady
Moini. Totally agree with what you said. thx for the link to that extension, will give that a try. I seem to lose extensions with uploads, so will wait until I upgrade to 92.2.

Re: convert svg to jpg

Posted: Sat Oct 07, 2017 6:19 am
by ragstian
Hi.

I seem to lose extensions with uploads, so will wait until I upgrade to 92.2.


A lot of the recommendations (some found here on the forum) on installing extensions tells you to install them in the Inkscape install directory.

For me this is not the best solution as the extensions will not "survive" an upgrade or re-install of Inkscape.

Extensions you download and extensions you want to stay permanent
should NOT be copied to the Inkscape Installation directory.
(on my Windows 10 machine: "C:\Graphics\Inkscape\share\extensions".
Your install might use "C:\Program Files" or "C:\Program Files (x86)"
instead of the "C:\Graphics" as on my system.)
Rather they should be copied to the user extension directory,
on my Windows10 machine: C:\Users\ragnar\AppData\Roaming\inkscape\extensions

The path to this directory can be found in the Inkscape preferences by
typing: Shift + Control + P and then click the "System" - The path will be listed under System: User Extensions:.

By keeping the extensions in the user extension directory I don't have to re-install extensions with every upgrade.
I have several versions of Inkscape on my machines and only need to keep one set of extensions for all of them.

Do not copy the extensions witch are part of the Inkscape installation to the user extensions directory as some of the extensions receive upgrades and bug fixes from one version to the next. You always want the latest versions of the extension files.

Re: convert svg to jpg

Posted: Sat Oct 07, 2017 6:31 am
by Moini
For more extensions and general instructions for installing extensions (operating system independent), see also:
https://inkscape.org/en/gallery/%3Dextension/