I turned my hand to church heraldry and created a series of images, all derivative of each other, to go on WikiCommons. The first ones were 10-20 KB or thereabout, but suddenly they were up to 2, 3 or 4 MB with no great increase in complexity. I started taking the images apart, and each grouped element was only a few dozen KB, so I moved each element, reassembled them as a new file, and suddenly a 5 MB file was just 220 KB. I then took another, 2.7 MB file, I deleted each element from the old file and the blank image was still 2.5 MB! I looked at the code behind it (which I have not even tried to read) and was enormous. It is as if the file code was remembering all past edits.
I am using Windows 10 I have Inkscape 0.92. I have attached a file that went to 4.89 MB: when I copied all the elements and pasted them into a new file, the resultant file was 226 KB. Also attached is a 2.4 MB blank image!
I did the copying and pasting on another computer, possibly with an earlier version of Inkscape, but I noticed the same 'ballooning' effect on that one too.
Because the images are a long series, I open an image I did earlier (which itself would be based on an earlier one), delete the objects I will not need, change the colours, then start putting new objects in, making improvements etc. The code might be an accumulated left-over from the parent files, as if when I delete an object it leaves part of the code behind.
I turned my hand to church heraldry and created a series of images, all derivative of each other, to go on WikiCommons. The first ones were 10-20 KB or thereabout, but suddenly they were up to 2, 3 or 4 MB with no great increase in complexity. I started taking the images apart, and each grouped element was only a few dozen KB, so I moved each element, reassembled them as a new file, and suddenly a 5 MB file was just 220 KB. I then took another, 2.7 MB file, I deleted each element from the old file and the blank image was still 2.5 MB! I looked at the code behind it (which I have not even tried to read) and was enormous. It is as if the file code was remembering all past edits.
Describe your OS & version, the version of Inkscape and the installer you used.
Bonus points, if you:
I am using Windows 10 I have Inkscape 0.92. I have attached a file that went to 4.89 MB: when I copied all the elements and pasted them into a new file, the resultant file was 226 KB. Also attached is a 2.4 MB blank image!
I did the copying and pasting on another computer, possibly with an earlier version of Inkscape, but I noticed the same 'ballooning' effect on that one too.
Because the images are a long series, I open an image I did earlier (which itself would be based on an earlier one), delete the objects I will not need, change the colours, then start putting new objects in, making improvements etc. The code might be an accumulated left-over from the parent files, as if when I delete an object it leaves part of the code behind.
The svg file has many unused gradient definitions. It is a simple matter of using Menu: File>Clean Document.
That is brilliant - thank you. I had not tried the "Clean document" function before, but it works a treat.