2

Somehow I've ended up with an Inkscape SVG file of over 300 megabytes which is now impossible to open.

I was doing a caricature using a collage of photos of each aspect of the subject's face subject (eyes, nose etc.) and drawing over the collage. It was a detailed drawing and I was creating individual hairs for the moustache, eyebrows and scalp by grouping and duplicating as appropriate (hundreds of times perhaps). It's a technique I've used successfully before with Corel Draw XIV.

All was going well and I was nearly done when Inkscape suddenly slowed down and eventually crashed. now it's reloaded but won't open the file. I had no idea the file had reached that size. What can I do?

1
  • Are the raster images linked or embedded? If you link the images instead, the Inkscape SVG file size will be much smaller.
    – Billy Kerr
    Commented Dec 17, 2017 at 12:00

3 Answers 3

2

It probably is not so much the file size but the summed up size of included bitmap images that give you an issue in your limited RAM. Therefore you will have to clean up your SVG tp give it a manageable size.

There are some options if you can't open such a file for editing.

  1. Terminate all programs running in parallel or even in the background to leave as much memory space as possible for Inkscape. Try a document cleanup if it was loading.

  2. Put Inkscape in View > Display mode > Outline mode for not loading bitmaps into the memory.

  3. Try to open a huge file in a lightweight editor which would need much less RAM than your Inkscape instance. Then search and remove objects manually.

  4. If it was still to big, split it in several parts. There are several Windows tools for file splitting, or in Unix/Linux use the following command to split files in two parts:

    split --number=2 [hugefile[prefix]]
    

    Then open each part for manual editing.

  5. Carry a huge file to a computer with plenty of RAM for editing.

2
  • With "manual editing", do you mean opening them in a text editor and manually flipping the nodes with the images out? Perhaps a split is not even necessary then. Commented Jan 21, 2018 at 0:52
  • @RudyVelthuis: so true - it is step 3 to try. If the bitmaps were embedded an editor may still not load the file.
    – Takkat
    Commented Jan 21, 2018 at 8:32
2

You could use SVGO to minify the file, which you could try online here. There is an option to remove bitmap.

2
  • Do you really think a 300MB file upload would work well in a browser app?
    – AAGD
    Commented Dec 18, 2017 at 12:14
  • 1
    Because it is a github page I assume it is being done in the browser (without upload) and there is an option to remove bitmaps and yes, I think that the browser is more capable of dealing with heavy bitmaps than Inkscape. Commented Dec 18, 2017 at 14:06
1

I see two questions here:

  1. Recovering your work
  2. Avoid such problems in the future

1.: If you go to the menu entry Edit/Preferences, "Input/Output"/Autosave-Dialog, autosave folder - there you find where the backups are stored. Maybe a previous version is still working. Of course, if inkscape is 100 minutes open with an intervall of 10 minutes and 10 instances to store, they all end up to be the same image, so maybe you can make a copy of them quickly.

2.: If you use larger objects (bytesize, complexity, not width/height, of course) multiple times, don't copy them, but clone them. A clone needs much less space but note, that it can't be manipulated (except for rotation, size, location), only the original can and changes there will affect all your clones.

And avoid to embed bitmaps, but link them in.

And you can try the 'File/Clean up document' function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.