convert svg to jpg

General discussions about Inkscape.
Gitte
Posts: 1
Joined: Mon Oct 02, 2017 6:03 pm

convert svg to jpg

Postby Gitte » Mon Oct 02, 2017 6:16 pm

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

Moini
Posts: 2213
Joined: Mon Oct 05, 2015 10:44 am

Re: convert svg to jpg

Postby Moini » Mon Oct 02, 2017 11:00 pm

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.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
flamingolady
Posts: 673
Joined: Wed Jun 10, 2009 1:40 pm

Re: convert svg to jpg

Postby flamingolady » Tue Oct 03, 2017 7:24 am

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.

Moini
Posts: 2213
Joined: Mon Oct 05, 2015 10:44 am

Re: convert svg to jpg

Postby Moini » Tue Oct 03, 2017 1:06 pm

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.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

theozh
Posts: 413
Joined: Fri Mar 23, 2012 6:30 pm

Re: convert svg to jpg

Postby theozh » Thu Oct 05, 2017 9:45 pm

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.
Win7/64, Inkscape 0.92.2

User avatar
flamingolady
Posts: 673
Joined: Wed Jun 10, 2009 1:40 pm

Re: convert svg to jpg

Postby flamingolady » Fri Oct 06, 2017 8:04 am

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.

Moini
Posts: 2213
Joined: Mon Oct 05, 2015 10:44 am

Re: convert svg to jpg

Postby Moini » Fri Oct 06, 2017 10:52 am

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
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
flamingolady
Posts: 673
Joined: Wed Jun 10, 2009 1:40 pm

Re: convert svg to jpg

Postby flamingolady » Sat Oct 07, 2017 5:02 am

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.

User avatar
ragstian
Posts: 1159
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: convert svg to jpg

Postby ragstian » Sat Oct 07, 2017 6:19 am

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.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Moini
Posts: 2213
Joined: Mon Oct 05, 2015 10:44 am

Re: convert svg to jpg

Postby Moini » Sat Oct 07, 2017 6:31 am

For more extensions and general instructions for installing extensions (operating system independent), see also:
https://inkscape.org/en/gallery/%3Dextension/
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

disposableorchestra
Posts: 2
Joined: Wed Dec 06, 2017 4:01 pm

Re: convert svg to jpg

Postby disposableorchestra » Wed Dec 06, 2017 4:11 pm

Not to hijack the thread or anything, but I downloaded Inkscape tonight to make some images for an app I'm working on. I want to be able to use scalable graphics to address issues with the app being used on different platforms (e.g., iPad vs iPhone) with different display dimensions. So, I did a tutorial and drew a simple shape and went to export it as an .SVG and much to my surprise, you can't export in .SVG (apparently). I can export as .PNG, but .PNG will not scale up with resolution loss (or so I've read). So, I don't get it. What's the point of creating a vector image only to be unable to export it for use in a vector format (i.e. svg) that I can scale up or down without resolution loss? I'm probably missing something crucial here, so I'm ready to be set straight.

I guess the idea (if my understanding above is correct) is to export as a .PNG, but make it larger than or equal to the largest size I would anticipate using in my apps? Thanks for the input.

User avatar
Xav
Posts: 967
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: convert svg to jpg

Postby Xav » Wed Dec 06, 2017 7:23 pm

Inkscape's native format is SVG, so you should use "Save as..." rather than "Export" to save as an SVG file.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

tylerdurden
Posts: 1815
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: convert svg to jpg

Postby tylerdurden » Wed Dec 06, 2017 10:09 pm

Please start a new topic when you have an unrelated question.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

theozh
Posts: 413
Joined: Fri Mar 23, 2012 6:30 pm

Re: convert svg to jpg

Postby theozh » Thu Dec 07, 2017 7:35 am

@Gitte, are you still here...?
If not, the following might also be helpful to others.
I still assume you want to include an SVG into MSWord(?) and you don't want to lose the quality of the SVG by converting it to .png or .jpg?
Try the following:
- open the SVG with Inkscape
- select all objects (Ctrl+A)
- copy the objects (Ctrl+C) to the clipboard
- go to MSWord and Paste | Paste Special (Alt+Ctrl+V) | Picture (Enhanced Metafile)

It looks like vector data is included which you can also check if you create a PDF. You can zoom in endlessly always having best quality. I don't know whether this will always work, but at least this seems to work on a Win7 system with MSOffice2013 Home&Student. If you are pasting with Ctrl+V, just a pixelated image will be included.
Win7/64, Inkscape 0.92.2


Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 4 guests