How do you remove embed pictures

Post questions on how to use or achieve an effect in Inkscape.
larienna
Posts: 62
Joined: Sat Aug 14, 2010 3:32 am

How do you remove embed pictures

Postby larienna » Mon Mar 14, 2011 1:09 am

I am creating a document with pictures and texture that I will use as a model for other documents. These additional documents will have pictures and textures of their own.

The problem is that if I use document A as a template for document B, delete all the pictures from document A and add new pictures for document B, all the pictures that were in document A are still embed in the SVG file even if I do not need them.

Is there a way to do the clean up of the pictures that are embedded in a SVG file?

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

Re: How do you remove embed pictures

Postby Uktrunie » Mon Mar 14, 2011 3:26 am

Well, I couldn't reproduce that behavior, a matter of luck I guess. So I don't know if this is going to work, but maybe cleaning the definitions solves the problem.

Going to File > Vacuum Defs will remove all unused definitions from the file, and I think it might get rid of those pictures.

Hope it helps.

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

Re: How do you remove embed pictures

Postby brynn » Mon Mar 14, 2011 4:30 am

Well, I have no idea about this, and have not even tried it. But in Extensions menu > Images, there are 2 options -- one to embed images, the other to extract. I don't suppose that Extract Image might work for you???

larienna
Posts: 62
Joined: Sat Aug 14, 2010 3:32 am

Re: How do you remove embed pictures

Postby larienna » Mon Mar 14, 2011 7:12 am

Extract image is useful to get back your original file if you don't have it anymore, but it does not necessarily remove the picture from the SVG.

I'll try vacuum def later and see if it works.

larienna
Posts: 62
Joined: Sat Aug 14, 2010 3:32 am

Re: How do you remove embed pictures

Postby larienna » Mon Mar 14, 2011 7:38 am

Vacuum def seem to have reduced my file size and some unused textures are not in the list anymore. But since I cannot see the complete list of embed picture, I cannot be certain that everything unused has been removed. But it seems to do a part of the work.

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

Re: How do you remove embed pictures

Postby ~suv » Mon Mar 14, 2011 10:06 am

larienna wrote:Vacuum def seem to have reduced my file size and some unused textures are not in the list anymore. But since I cannot see the complete list of embed picture, I cannot be certain that everything unused has been removed. But it seems to do a part of the work.

How do you "embed" your images?

  1. link/embed
    Images embedded on import (where you have the choice to 'embed' or 'link' since Inkscape 0.48) or embedded using the extension 'Extensions > Images > Embed Images…' do not store any information outside the <image> tag - i.e. when you deleted the embedded image, all related information is deleted (purged) from the SVG file.
  2. patterns
    If you "embed" images by converting (embedded) imported images to patterns, the image data will be stored as pattern definition in the <defs> section of the SVG file. To delete all unreferenced (unused) pattern definitions, 'File > Vacuum defs' should work just fine. Do run the command 'Vacuum defs' twice (after saving and reopening the file in-between) - sometimes there are still references to a pattern in memory, and the pattern definition can only be purged after reopening the file again.
  3. images from PDF/PS/EPS import
    If you didn't "embed" the images in Inkscape itself, but imported e.g. PDF (or PS/EPS) files with raster images included, your images are possible masked with an inverted black&white copy of the image (in raster format, embedded) to achieve a transparent background. Deleting such an image without releasing the mask first will leave the mask definition (an embedded bitmap) intact until you run 'File > Vacuum defs'.
For further assistance it would help to be able to inspect a file where you think that embedded raster image data cannot be deleted and causes a bloated file size. Could you attach an example SVG file (zipped if file size is too big), or use an external sharing (e.g. dropbox) or image hosting service (e.g imgh.us which accepts and serves SVG files)?

larienna
Posts: 62
Joined: Sat Aug 14, 2010 3:32 am

Re: How do you remove embed pictures

Postby larienna » Thu Mar 17, 2011 10:52 pm

I use method A and B. I would need to do further test to see if there is really a problem with embeding by comparing file size (if I have the time, I might do it). I simply had suspicions because derived files where larger than the original file. For patterns, they get destroyed with vacuum def, so that is a good thing.

Does cloning embeded images would have any negative effect on the embedding?

kingofpop12
Posts: 4
Joined: Mon Jan 02, 2012 8:09 am

Re: How do you remove embed pictures

Postby kingofpop12 » Mon Jan 02, 2012 10:36 am

Hey I'm having exactly the same problem. My project is 960 x 640px with tiles every 32. I'm just drawing some basic game tiles using standard shapes and gradients and my file size is 130mb. I can hardly work on it as its so slow. I imported some pictures (various file types) used the trace option then deleted the pictures but the file size still thinks thr pictures are there.
When I imported I selected to embed not actually knowing what I was doing, is there anything I can do to rectify this? I tried the vacuum def but it made no difference to the size, I'm no expert but it shud b max 1/2mb if tht...

I also opened it with notepad++ and couldn't see any indication of the images there, please can someone help?

Thanks

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

Re: How do you remove embed pictures

Postby brynn » Mon Jan 02, 2012 2:58 pm

If you could provide the SVG file, we could try to find what's making the file so large. You could attach to a reply, or upload wherever you prefer.


Return to “Help with using Inkscape”