Extensions>Images>Embed vs Drag/drop-embed of jpeg

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
Mar
Posts: 22
Joined: Thu Aug 13, 2009 4:06 am

Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby Mar » Fri Sep 23, 2011 8:06 pm

Hello,

When I drag and drop a jpg image to a project I get the option to either link or embed it. If I choose embed, the image is recompressed to a lower quality than the original. If I instead choose to link the image and then use the Extensions > Images > Embed image menu choice, the image is embedded without additional compression.

Is this intentional, a bug, or am I just doing something weird?

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

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby brynn » Sat Sep 24, 2011 2:31 am

Hi Mar,
That's interesting. I'm sure other more knowledgable members will be able to explain it.

I can't explain it, but I've been working with an embedded JPG. So I tried importing it again, side by side, and this time linked instead of embedded. I can't tell any difference visually. How have you determined that it's compressed? Do you see a visual difference, or is it after saving that you notice a difference in file size?

User avatar
BobSongs
Posts: 324
Joined: Fri Sep 14, 2007 2:18 pm
Location: Montreal, Canada

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby BobSongs » Sat Sep 24, 2011 6:40 am

If the source JPEG (jpg) file remains in its folder -- then linking is the way to go. I'm not aware of any degradation of the jpeg information, however this might be possible.

The only reason I can think of for embedding a JPEG/jpg file into a document is if the SVG file ends up sent to another person. This gets rid of the need to attach additional bitmaps.

Can anyone else suggest a reason why a jpg should be embedded? Seems to only bloat the file size unnecessarily.

Thoughts?

Mar
Posts: 22
Joined: Thu Aug 13, 2009 4:06 am

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby Mar » Sat Sep 24, 2011 7:21 am

I use Inkscape to produce PDF-files and like to keep the blueprint in one spot, quite simply. Also, the issue is that while drag-and-drop-embedding lowers the image quality, choosing the option from the menu does not.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby ~suv » Sat Sep 24, 2011 9:59 am

Mar wrote:I use Inkscape to produce PDF-files and like to keep the blueprint in one spot, quite simply. Also, the issue is that while drag-and-drop-embedding lowers the image quality, choosing the option from the menu does not.
Referring to image quality as displayed in Inkscape on-canvas, in an exported bitmap of the drawing, or in the produced PDF file?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby ~suv » Sat Sep 24, 2011 10:21 am

A known difference (in formatting only) between embedding a bitmap image via 'Drag&Drop' or 'File > Import…' and and the python-based 'Extensions > Image > Embed Image…' is described in this (otherwise unrelated) comment. Edit: actually I was thinking about a different comment/question, but failed to find it :/

Mar wrote:When I drag and drop a jpg image to a project I get the option to either link or embed it. If I choose embed, the image is recompressed to a lower quality than the original. If I instead choose to link the image and then use the Extensions > Images > Embed image menu choice, the image is embedded without additional compression.
You don't tell how you determine or confirm that "the image is recompressed to a lower quality" in Inkscape (unless you extract the embedded image again (with 'Extensions > Image > Extract Image…') and check the compression level in an external image viewer). Or again, you are referring to the generated PDF file and the information you extract from the PDF file about embedded images in that file.

With regard to compression levels of JPEGs: those do not carry over to PDFs generated with Inkscape (AFAIU there's no difference whether the bitmap image was embedded or linked into the SVG document):
Could you attach such an unedited JPEG image (of the kind you want to embed in the SVG file) here, to allow testing on other platforms whether there are differences in the image code embedded in the SVG file itself- depending on the method used for embedding (internal, or via python-based extension)?

Which Inkscape version do you use, on which platform?

Mar
Posts: 22
Joined: Thu Aug 13, 2009 4:06 am

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby Mar » Fri Oct 14, 2011 5:43 pm

~suv wrote:A known difference (in formatting only) between embedding a bitmap image via 'Drag&Drop' or 'File > Import…' and and the python-based 'Extensions > Image > Embed Image…' is described in this (otherwise unrelated) comment. Edit: actually I was thinking about a different comment/question, but failed to find it :/

Mar wrote:When I drag and drop a jpg image to a project I get the option to either link or embed it. If I choose embed, the image is recompressed to a lower quality than the original. If I instead choose to link the image and then use the Extensions > Images > Embed image menu choice, the image is embedded without additional compression.
You don't tell how you determine or confirm that "the image is recompressed to a lower quality" in Inkscape (unless you extract the embedded image again (with 'Extensions > Image > Extract Image…') and check the compression level in an external image viewer). Or again, you are referring to the generated PDF file and the information you extract from the PDF file about embedded images in that file.

With regard to compression levels of JPEGs: those do not carry over to PDFs generated with Inkscape (AFAIU there's no difference whether the bitmap image was embedded or linked into the SVG document):
Could you attach such an unedited JPEG image (of the kind you want to embed in the SVG file) here, to allow testing on other platforms whether there are differences in the image code embedded in the SVG file itself- depending on the method used for embedding (internal, or via python-based extension)?

Which Inkscape version do you use, on which platform?


Hello!

I'm sorry it took this long to respond, I had forgotten about the issue (or learned to work around it rather.)
Take a look at the following image:
exhibit_a.png
Three instances of inkscape containing nothing but the unaltered test image shown at the bottom of the post. The leftmost image is linked in by drag/drop; in the second window, the image has been embedded using Extensions > Images > Embed Images...; the third frame contains the image when it has been embedded after drag/dropping the original over the window.
exhibit_a.png (205.1 KiB) Viewed 7569 times


Compare the JPEG artifacting of the rightmost window to the two other. There should be a noticable difference.

Original test image:
testpic.jpg
The original, JPEG compressed image
testpic.jpg (5.07 KiB) Viewed 7569 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby ~suv » Fri Oct 14, 2011 7:52 pm

Mar wrote:Compare the JPEG artifacting of the rightmost window to the two other. There should be a noticable difference.

Original test image: (…)

Thank you for the detailed information (screenshots & original JPEG image). Based on it I have been able to reproduce it. Then I recalled a bug recently filed about this (Bug #871563 in Inkscape: “JPG pasting in trouble with resolution”) and confirmed it.

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

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby brynn » Sat Oct 15, 2011 9:59 am

Aaahhh....
When I tested it, I did not zoom in at all. Since ~suv has confirmed the bug, I won't test further. But I do see that the one on the right is a little different, in your screenshots.

RolPasto
Posts: 1
Joined: Fri Apr 13, 2012 12:23 am

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby RolPasto » Fri Apr 13, 2012 12:57 am

If it is of some interest for someone, I have faced the same problem with Inkscape 0.48.1: when the imported image is linked -> no pb, but when it is embedded -> quality loss
I updated to 0.48.2 and the problem is still here.

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

Re: Extensions>Images>Embed vs Drag/drop-embed of jpeg

Postby brynn » Fri Apr 13, 2012 1:57 am

Welcome to the forum :D

I have a couple of questions. Is this also with JPGs that you notice this? Also, what is "pb"?
(Note that it may take years to fix some bugs. It depends how critical it is, and I think also how often it's been reported. You could follow the above link to the bug report to somewhat follow the progress.)


Return to “Discuss Software Issues”