Export as JPG?

Flesh out your ideas for new or improved Inkscape features before submitting a request.
scruffyeagle
Posts: 22
Joined: Sun Nov 07, 2010 7:19 pm

Export as JPG?

Postby scruffyeagle » Sun Nov 07, 2010 7:52 pm

I'm new to Inkscape and vector graphics, but I've already found that I'm dissatisfied with the quality achieved via exporting as PNG. Taking an exported PNG copy and zooming in, it's bitmap basis become quickly apparent with all the jagged edges on curves, angled lines; anything which doesn't follow a direct vertical or horizontal path. Part of what attracted me to Inkscape and vector graphics in general, is the ability to achieve scalable graphics that don't develop jagged edges when zoomed. When I zoom in on a circle in Inkscape, my monitor can show the edges of the circle as being nice and smooth. Export that as a PNG bitmap, and look at all the notches along the ragged edges! I spent about an hour and a half yesterday, searching the web for ANY freeware that could manage turning an SVG file into a JPG, and failed miserably. Not even one freeware option out there, as far as I could tell.

I eventually came up with a solution I'll share here in my first post; a work-around, toward getting a better quality image that can be posted on standard forums. The key to my solution is that Inkscape can export a SVG file as a PDF file. A PDF file is a graphics file, and there are freeware utilities that can convert the contents of a PDF file into a JPG image. The one I finally tracked down and used is "office-convert-pdf-to-jpg-jpeg-tiff-free.exe". (Sorry, I didn't bookmark the link - but, you should be able to find it via using Google.) Adobe Acrobat can display documents in "Full screen mode", where nothing is on the screen except the contents of the file. I used a screen capture utility called "MWSnap300.exe" to hotkey-capture the entire screen when Acrobat was displaying the PDF of one of my pictures. I'd set the output preferences in MWSnap to create JPG's of the snaps. So, when I examined a resultant JPG, there was my picture WITHOUT jagged edges on the lines! It was a much better quality than could have been achieved via PNG, and the resolution of the JPG was in accordance with the 1200 pixel width of my monitor.

What I'm hoping to instigate via this post, is the idea that Inkscape's usefulness would be greatly increased if it had the native capability of producing high-quality JPG's as an additional export option.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Export as JPG?

Postby brynn » Mon Nov 08, 2010 3:46 am

Taking an exported PNG copy and zooming in, it's bitmap basis become quickly apparent with all the jagged edges on curves, angled lines; anything which doesn't follow a direct vertical or horizontal path. Part of what attracted me to Inkscape and vector graphics in general, is the ability to achieve scalable graphics that don't develop jagged edges when zoomed. When I zoom in on a circle in Inkscape, my monitor can show the edges of the circle as being nice and smooth. Export that as a PNG bitmap, and look at all the notches along the ragged edges!

Well yes (duh) that's what we would expect. The quality of the PNG is not a shortcoming of Inkscape, it's a shortcoming of raster graphics entirely.

I can't really speak to the possibility of including JPG export to Inkscape. But I can guess that the response (or one of them) will be that there are plenty of graphics programs already existing that produce high quality JPGs.

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Export as JPG?

Postby Grobe » Mon Nov 08, 2010 4:48 am

I hope "export as jpg" wont be a feature of Inkscape as JPG-pictures goes ugly compared with PNG's. Agreed bith Brynn, use a third party app to convert to jpg.

For windows there is many alternatives. Three good one: Irfanview, XnView and FSIV ;)
:lol:

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Export as JPG?

Postby druban » Mon Nov 08, 2010 4:52 am

There is a fundamental misunderstanding here, in that both formats are always raster and JPG quality is always (yes, ALWAYS) lower than PNG. There is absolutely no case where, If you are observing results that appear to be the opposite, the reason cannot be traced back to a resolution difference, i.e. the jpeg has a higher resolution - more pixels - than the PNG. However, the relative size of the files is not an indication of the resolution, since jpg files are smaller than PNG at the same resolution.
One reason Inkscape exports in PNG because you can always convert a PNG to JPG and still have the original without the compression artifacts but if the original export were JPG you would have no uncompressed version to compare to to see what you had lost. The other reason that is hugely relevant is that PNG has an alpha channel and JPG specifications do not allow one. When GIF was common this was the reason people chose the very limited color paleette of gif over JPG's unlimited range of color, but with PNG there's no compromise necessary.
Last edited by druban on Mon Nov 08, 2010 7:17 pm, edited 1 time in total.
Your mind is what you think it is.

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: Export as JPG?

Postby tomh » Mon Nov 08, 2010 5:30 am

When exporting to a bitmap (if it is necessary) always use File->Export bitmap (this is Inkscape's best png export route) .

For doing print work, insure the resolution is set to 300dpi+ as this is the resolution that most printers work at/ their rasterization dpi. (Default dpi is set for screen display dpi for websites which is 90dpi and will give jagged results). Note that an 8 megapixel photo will be ~600dpi when printed at 10cm by 15cm, to give an indication of digital camera resolutions.

png or jpg should make no difference whatsoever in terms of jaggedness at the same dpi setting. Jpg is limited as it cannot cope with transparency and has compression artefacts which make it a poor choice for rasterizing vector drawings.

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Export as JPG?

Postby Grobe » Mon Nov 08, 2010 6:43 am

tomh wrote:Jpg is limited as it cannot cope with transparency and has compression artefacts which make it a poor choice for rasterizing vector drawings.
Thanks for putting word on it. That's what I meant :)
:lol:

scruffyeagle
Posts: 22
Joined: Sun Nov 07, 2010 7:19 pm

Re: Export as JPG?

Postby scruffyeagle » Tue Nov 09, 2010 6:24 pm

I'm sorry, but it's simply not true to say that there's higher quality in the PNG copy. To illustrate this, I made a 1024x768 page in Inkscape and put a large black circle with no fill just slightly smaller than the page; nothing else. I exported the SVG as a PNG, then saved it as a PDF. I opened the PDF in Acrobat and went to full screen mode, then used MWSnap hotkey-activated to take a JPG snapshot at 100% quality level of my 1024x768 screen. I've attached both the PNG copy & the JPG copy with this post. If you use Xnview (my favorite) to examine both and zoom in, it's easily visible that although the PNG copy has thicker, darker lines, the lines are much more ragged at the edges. The JPG copy's lines are thinner, but the lines that are much smoother. This is because the JPG has what might be thought of as "ghost" pixels added from pixels that might have been found in the PNG copy being blurred slightly. (Really zoomed in, you can see them.) Are these artifacts of the JPG-making process? Not necessarily. Remember, both the PNG bitmap and the JPG are approximations of the vector graphics contents, NOT identical to the contents. In my opinion, the JPG version is actually more accurate. Here's why: A vector graphics circle is mathematically smooth. Given a circle with thickness, there would never be any zoom level where disruption of the evenly arcing continuity of the edge would be found. Pixels approximate what light value might be found at some location in relation to the circle. Zoomed in on the PNG copy, you find a sawtooth edge with nothing at all between the points. Zoomed in on the JPG copy, you find the ghost pixels that have a net effect of evening out the cycling of light & dark travelling around the circumference of the circle. That's smoother, which closer to accurately representing the edge of a mathematical circle - and, if you're doing artwork, that smoothness can be a very good thing. That's why I'd like to see Inkscape able to produce it in a saved or exported JPG file.
Attachments
1024x768 circle.jpg
1024x768 circle.jpg (48.71 KiB) Viewed 74063 times
1024x768 circle.png
1024x768 circle.png (24.1 KiB) Viewed 74063 times

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Export as JPG?

Postby brynn » Tue Nov 09, 2010 8:06 pm

Well, I do see a difference between your PNG and your JPG, but I would guess that many people would not even notice it. I think in this case, it's simply a matter of personal preference. When looking such a small difference in display, I would venture to conclude that it boils down to individual physiology -- the way your eyes work causes you to prefer one over the other. When I had cataracts, I probably could not have discerned a difference at all. And even now, with "bionic eyes" (lens implants), I know there are times when anti-aliasing drives me crazy, lol!

Also, when the difference is so small, I would guess that the quality of the screen or monitor plays a huge role. I wonder if I looked at these on my old crt monitor, whether I could even notice a difference at all??

But for me, the bottom line is this -- When we have SVG (or vector graphics in general) there is simply no need for high quality JPG, or PNG, or any raster format. Vectors surpass rasters in every case. As far as display on the web, yes, we still need raster formats. But Microsoft has begun the process of supporting SVG display in Internet Explorer. I expect it will be a few years before full support, but raster formats appear to me to be "a dying breed" so to speak.

I'm not well informed about printing, so perhaps raster formats will always be needed there? Honestly I'm just not familiar with the printing of computer graphics. But now we're back around to the difference between display quality being so very small.....I don't think the effort to add the exporting of JPGs would be a very good use of developers' time and energy. Especially, again, when there are plenty of other programs out there.

JMO :D

Slow Dog
Posts: 180
Joined: Wed Sep 24, 2008 7:51 pm

Re: Export as JPG?

Postby Slow Dog » Tue Nov 09, 2010 10:47 pm

scruffyeagle wrote: Part of what attracted me to Inkscape and vector graphics in general, is the ability to achieve scalable graphics that don't develop jagged edges when zoomed. When I zoom in on a circle in Inkscape, my monitor can show the edges of the circle as being nice and smooth.


If you stay in svg, you get vector smoothness at any scale. Once you export to jpg or png, you lose that.

The real question is, why are you exporting? For what is purpose is the exported file? Because, when you're exporting, you're implicitly saying "I've finished drawing this file, and I'm going to render it at a resolution that's relevant to my purpose, for a medium that doesn't allow zooming"; so you can send it to a printers, or display it on a web page, or whatever.

If you answer is "I'm exporting for a medium that's supposed to allow zooming", then ideally, you shouldn't be exporting at all. You should be displaying the svg as-is (or perhaps as plain svg) in that medium; say, using Firefox, or some other svg viewer/plugin. Or, as a last resort if you really have to use something that can't display svg, you export at (say) 100x the size you actually want to show by default, and allow user to zoom as they want; but you're now relying on something being able to smoothly scale raster images, rather than anything inherent in vector graphics.

scruffyeagle
Posts: 22
Joined: Sun Nov 07, 2010 7:19 pm

Re: Export as JPG?

Postby scruffyeagle » Thu Nov 11, 2010 8:48 pm

Hi! Thanks for the replies.

Brynn: I searched and searched. I couldn't find even one freeware program that was able to do a conversion between SVG and JPG. Not even one.

Slow Dog: That's a good suggestion, exporting at something like 100x the intended final size. The bitmap could then be scaled into a JPG using something like Gimp. The scaling-down process would have the effect of evening out the edges of curves and angled lines.

My purpose in using vector graphics is as an accessory for doing artwork. Vector graphics are wonderful in their ability to quickly and easily create smooth curves, to create exactly sized objects, and also to make elements of scenes easily moved independantly of other scene elements. But, vector graphics isn't sufficient in an of itself for doing digital art. For example, let's say you create a blue stroke circle with a red fill interior. But, what if you want to take just half of the upper left quadrant of the stroke and blur just that one section? Would you use an arc overlay? Moving the circle from a vector format into a pixellated format would make that blurring easy - especially useful, if you could then save the modified circle as a pixellated object for use elsewhere later. My expectation for the future, is that at some point a program will be available that can manage both pixellated and vector operations; probably, managing this by setting layer characteristics. For example, making 2 new layers, I specify that layer one is going to hold pixellated contents, and layer two will be holding vector-defined contents. I suspect Gimp is the prime candidate for such evolution...

Many years ago, I had a hobby of photography. There was still a lot of resistance in the art community, to allowing photographic images to be granted the status of being art. Then, came digital cameras. The "real" photographers snubbed their noses at digital cameras as being incapable of taking high quality pictures - that, pixellation could never be valid as art. Now, pixellated imagery is the primary artistic medium of the masses and analog imagery is reserved for those who can afford expensive equipment. But, "what is art?" is a question that still haunts us, and "what is good art?" is still hotly debated. The digital medium is exactly that; digital. Therefore, pixellation will always be with us until our display devices no longer use digital methods. Design in vector format is wonderful - but, always ends up converted to digital, discrete pixels for display. The real question that needs to be considered in selecting an output format of digital display, is what's the most accurate for converting analog contents to digital display? And, as my previously posted simple example showed, JPG output is closer to the analog vector original in terms of smoothness.

All of that aside, there's one very good reason for placing the creation of JPG format images as a high priority. The vast majority of the image contents of the internet are in that format. From a personal persepctive, I'd find it advantageous because I have a Flikr.com account, and post artwork online there. I'm picky about my artwork. I want the highest quality I can manage. I hadn't tested this yet, so after writing the previous sentence, I logged in at Flikr and tried to upload a SVG file. The file upload dialog box wasn't able to find the SVG images I have on my machine. It didn't recognize them as being image files. Flikr won't accept SVG images. It did find the JPG & PNG files, but not the SVG's.

Slow Dog
Posts: 180
Joined: Wed Sep 24, 2008 7:51 pm

Re: Export as JPG?

Postby Slow Dog » Fri Nov 12, 2010 12:24 am

scruffyeagle wrote:The bitmap could then be scaled into a JPG using something like Gimp. The scaling-down process would have the effect of evening out the edges of curves and angled lines.

That's not what I meant at all. You're throwing away information, and then it's a just a matter of taste as to whether Gimp's scaling or Inkscape's export does a better job. Scale down only at the end...

All of that aside, there's one very good reason for placing the creation of JPG format images as a high priority. The vast majority of the image contents of the internet are in that format.

The JPG format is expressly designed to hold photographs of natural objects with decent quality at high levels of compression. It's thus the ideal format for photographs. Its lossy compression algorithm introduces artefacts that are (supposed to be) hard to see in natural scenes, but are obvious in vector images. As a rule of thumb, if it's not a photograph, it shouldn't be a JPG, but its a rule often violated. I've seen it misused thus in a professional capacity, and for many of those online images to which you refer. I think there's a general misconception that pictures on the web should be JPGs for size, exacerbated by reluctance in the web's early (pre-PNG) days to use GIFs.

The PNG format is designed to hold drawn images at high levels of compression. Its lossless method is good at compressing large plain areas, good for drawings or screenshots, but poor for photographs (which are perfect, but unnecessarily large) . It produces no artefacts.

So, PNG is the right choice for Inkscape's export function.

None of which says which is format right for you when you finish your work; but it's absolutely the right format for getting your work from Inkscape to GIMP.


Other stuff:
Look into Inkscape's Filters. Ease-of-use isn't yet high, but they're very powerful, and there's not going to be much you can't do directly in Inkscape compared to the Gimp (if not as quickly).

And I'd love Inkscape SVG layers in GIMP as well. Here's hoping....

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Export as JPG?

Postby brynn » Fri Nov 12, 2010 9:52 am

For example, let's say you create a blue stroke circle with a red fill interior. But, what if you want to take just half of the upper left quadrant of the stroke and blur just that one section? Would you use an arc overlay?

Yes. Why is this such a problem?

The vast majority of the image contents of the internet are in that format.

One big reason for this, is that Internet Explorer can't display SVG images. But we have heard news in the past year that Microsoft is planning to offer limited support as early as IE9. I suspect that once all major browsers can display SVG, we will see the balance shift dramatically. Although that's strictly my opinion :D

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Export as JPG?

Postby Simarilius » Tue Feb 08, 2011 7:02 am

Unless someones cut it out as cruft the code is already there to export to jpg, I put it in a more than a year ago, it just doesnt have a menu item as I hadnt got round to it before the freeze for release.

User avatar
Loadus
Posts: 23
Joined: Wed Feb 16, 2011 5:58 am

Re: Don't Export as JPG.

Postby Loadus » Wed Feb 16, 2011 6:13 am

scruffyeagle wrote:My purpose in using vector graphics is as an accessory for doing artwork. Vector graphics are wonderful in their ability to quickly and easily create smooth curves, to create exactly sized objects, and also to make elements of scenes easily moved independantly of other scene elements. But, vector graphics isn't sufficient in an of itself for doing digital art.


I respectfully disagree.

I've been a lurker on this forum for a few years now and a user of inkscape even longer. I do professional artwork, like gamegraphics, using Inkscape: http://www.star-arcade.com/images/games ... pture2.png

Inkscape is far superior to many commercial software with it's speed - navigation on the canvas is just pure joy.

I'm still waiting for multipage implementation (even though it's sort-of-available through stuff like Jessyink) and keyboard shortcuts to all functions - like the "Resize page to drawing or selection", which is more like the 3D cursor in Blender than a mere 'once only' -function for me - and now it's hidden away, heh.

The day when Inkscape has multiple page editing/export and the canvas is GPU accelerated, it WILL be the King of the Hill.


But saying that Inkscape/vector is not good for art is big load of you-know-what. No offence. :D

jiri.reznicek.jr
Posts: 1
Joined: Thu Feb 24, 2011 11:22 pm

Re: Export as JPG?

Postby jiri.reznicek.jr » Thu Feb 24, 2011 11:49 pm

Hi all,

I think the problem shouldn't be solved by doing file format magic with freeware converters. It's like trying to rub left ear by right foot instead by hand.

I tried to create suggested black empty circle in Inkscape 0.48.1 and the problem is in how Inkscape outputs the circle object. No matter whether it is screen or exported image.

I also don't agree that the shape of circle is personal preference (ragged vs. smooth). Circle is circle and not a tooth wheel.
Don't defend programmers, just admit the fact that Inkscape doesn't have smooth lines and Illustrator (tm) does have. ;-)

In ideal case Inkscape should store circle's parameters in memory/svg file and then output it as accurate as it can.

But programming this is not a childplay. It depends on many factors.
- Does the output engine library support smoothed circles? If yes, it's simple. If not then it costs performance to draw it.
- Does the export library support smoothed circles? If yes, it's simple. If not how difficult is to implement it?
- if circles would be smooth then everything else should be smooth for consistency (lines, stars, boxes, everything). And this is a bunch of boring programmer and debugger work.


So the question is not WHETHER TO IMPLEMENT but WHO IS AVAILABLE TO IMPLEMENT :-)

troyd2010
Posts: 6
Joined: Tue Nov 16, 2010 11:01 am

Re: Export as JPG?

Postby troyd2010 » Sat Mar 19, 2011 4:19 am

I will add my 2 cents, because of a problem I encountered recently with Microsoft Office.

I created these beautiful vector graphics files, with Inkscape, using features like drop shadows, etc. which take advantage of transparency. I exported the images as PNG files and then placed them in my Microsoft Office Word document.

When I printed the files all of the drop shadows disappeared as did any other features using transparency. I thought that was odd, because it displayed properly on my screen.

After some digging, it turns out that Microsoft's raster engine for printing documents does not support transparency. So all of the transparency information disappeared. I had to manually convert all the PNGs to JPGs using Gimp. Not a difficult process, but time consuming when there are dozens of images to convert. Then all was well with printing.

Now I know many bright and snarky people will say don't use Microsoft, but in the business world, when you must share documents with other people who are used to Word, avoiding Microsoft, as much as I would like to, is not really an option.

I have given up on Visio and started using Inkscape for my drawings. I'll see if I can convert my colleagues ;)

It would at least be useful to export JPG directly even if there is disagreement over the quality.

Best Regards,
Terry

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Export as JPG?

Postby Grobe » Sat Mar 19, 2011 6:07 am

troyd2010 wrote:After some digging, it turns out that Microsoft's raster engine for printing documents does not support transparency. So all of the transparency information disappeared. I had to manually convert all the PNGs to JPGs using Gimp. Not a difficult process, but time consuming when there are dozens of images to convert. Then all was well with printing.
Hi.

I'd like to hand over a workaround. In Inkscape, add a bottom layer and draw a white, non transparent rectangle that covers the entire canvas. Then the exported picture won't have any transparent elements, thought it has support for it.

When it comes to convert pictures, Gimp isn't the most propriate tool for that. I'll suggest three programs that can do the batch convert in an easier way:
FSIV, IrfanView and XnView.
:lol:

troyd2010
Posts: 6
Joined: Tue Nov 16, 2010 11:01 am

Re: Export as JPG?

Postby troyd2010 » Sat Mar 19, 2011 8:54 am

Hey,

Thanks for the suggestion. I'll give it a shot.

Terry

GrannyGeek
Posts: 3
Joined: Wed Dec 23, 2015 2:33 am

Re: Export as JPG?

Postby GrannyGeek » Wed Dec 23, 2015 2:45 am

I noticed that you can select the size of the exported image. Apparently Inkscape smoothly enlarges to the designated size. I wanted an 8" square at 300 dpi. When I view the PNG in Photoshop at 100%, it's smooth as silk. It's smooth but slightly blurry at 200%. By 300% it begins to serrate.

Since I created the original drawing at high res for control of detail, I pulled it down to 30% of the original size, then exported at the same 2400 resolution. I got identical results. In Photoshop, IrfanView or whatever, it's easy enough to convert to jpg if that's what you need to do. Still, it would be handy to have that option straight out of Inkscape.

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

Re: Export as JPG?

Postby Moini » Wed Dec 23, 2015 3:32 am

How a raster image is displayed when it is enlarged beyond it's natural resolution depends entirely on the program you use to look at it, not on the program you used to create it (in this case, it's Photoshop's rendering engine that makes it first blurry, then blocky).

There exists an extension that allows to export to jpg directly, find it here: 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)


Return to “Inkscape Ideas”