Inkscape.org
Beginners' Questions Creating a svg file from two svg files results in a much larger file
  1. #1
    wpkzz wpkzz @wpkzz

    I have two svg files created with a scientific graphic program. One is 6.1 MB in size and the other is 735 KB. If I join them in inskcape ( by importing them to a blank page) and correct the size, the resulting svg measures 14 MB. This is MUCH more than the sum of its parts.
    It doesnt' have new objects.

    Why is that?

    How can I prevent that from happening?

  2. #2
    Tyler Durden Tyler Durden @TylerDurdenโš–

    Hard to say without seeing the files.ย 
    Inkscape makes web-standard svg files, so it may add code to follow the svg specification.ย 

  3. #3
    wpkzz wpkzz @wpkzz

    It may be, but how much code? 9MB of code... That would be a LOT of code.

    Let me show you the headers of the files and some samples:

    file1, header:

    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    ย  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <!-- Created with matplotlib (https://matplotlib.org/) -->
    <svg height="288pt" version="1.1" viewBox="0 0 288 288" width="288pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    ย <defs>
    ย  <style type="text/css">
    *{stroke-linecap:butt;stroke-linejoin:round;}
    ย  </style>
    ย </defs>

    file 1, some sample in the middle:

    ....

    ย 

    Ahhh forget about it... I just realized that the problem may be that the svg's have some png embeded in them, and those are stored as binary data inside the svg.

    Can it be the reencoding of these data the problem?

    That seems more likely.

    ย 

  4. #4
    Tyler Durden Tyler Durden @TylerDurdenโš–

    Hard to say. A scatter plot could have a couple thousand sample objectsย and if each one got inline style attributes as opposed to the CSS...

    You could make a copy, delete the bitmaps and see the effect.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Creating a svg file from two svg files results in a much larger file