I use Inkscape for many things including print, web graphics and SVGs for web animation. One thing that causes issues (and a lot of additional work/time) is cleaning up the code (to make the file size smaller and the code easier to read).
While I know that there are a number of workarounds (such as grouping objects before moving them, then ungrouping them, and the apply transforms extension). I have not found an efficient and reliable method that works in all circumstances.
Transformations which are really hard to clean up are:
Cloned objects (without 'uncloning' first)
Clipped objects
Colour gradients
While simple graphics can be easy to fix, more complex graphics are very tricky indeed and my efforts to clean them up inside Inkscape (grouping, moving, cutting and pasting in place in the correct position/order, then ungrouping) often cause Inkscape to crash.
While I love using Inkscape. I really do wish I had a better way to deal with these things.
Any advice on how to resolve these issues would be well-received.
Pacer, can you confirm that flatten works for a single element ?
I've tested it on single elements. I've found it does work, however on occasion you might no longer be able to break into the original subpaths.
For example if you have done Path>Combine then transformed, then flatten. It should look the same however sometimes you cannot Path>Break Apart to get the same (transformed) shapes to split out.
Flatten won't work for a multiple selection or group as it tries to flatten to visible paths.
If the 1st scenario works, I might be able to loop it on canvas.
It won't work with clones, as it converts to path first :(
However if you have a sequence that you know works with clones, It could be replicated ( maybe )
I think it would only work for translate to be converted to x, y as cannot covert rotate / scale without changing the path - and then it would not be a clone :)
Hi, I just want to put a post in here because I may need to reference this in the near future. I am just about to work on an animation where the background is 1.3mb already, which may not sound a lot, but by the time i get into 200 or 300 or 400 frames, the file size may rise dramatically.
Hi, no probs as yet, I just wanted to mark this thread for later reference. I haven't fully explored 1.3 yet and I was unaware of the path->flatten. I try to keep my projects small because my workhorse is an old Win7 2.2ghz laptop, although if need be, I do have a desktop I can use but that is not so much in my creative space . I am in the process of doing a series of short advertising gif animations; the first was 45 secs. I am now on the second one and the static background of scene 2 is 1.2 MB, so, assuming I end up with something in the order of 300-400 frames, that might be in the order of a 300+ MB file assuming my predictive math is correct. I am going to start drawing the animated part either tomorrow or the day after, and that is when the compacting might be required, cheers Sean.
I use Inkscape for many things including print, web graphics and SVGs for web animation. One thing that causes issues (and a lot of additional work/time) is cleaning up the code (to make the file size smaller and the code easier to read).
While I know that there are a number of workarounds (such as grouping objects before moving them, then ungrouping them, and the apply transforms extension). I have not found an efficient and reliable method that works in all circumstances.
Transformations which are really hard to clean up are:
While simple graphics can be easy to fix, more complex graphics are very tricky indeed and my efforts to clean them up inside Inkscape (grouping, moving, cutting and pasting in place in the correct position/order, then ungrouping) often cause Inkscape to crash.
While I love using Inkscape. I really do wish I had a better way to deal with these things.
Any advice on how to resolve these issues would be well-received.
I believe Inkscape 1.3's new Path ➞ Flatten does the job.
Pacer, can you confirm that flatten works for a single element ?
I've tested it on single elements. I've found it does work, however on occasion you might no longer be able to break into the original subpaths.
For example if you have done Path>Combine then transformed, then flatten. It should look the same however sometimes you cannot Path>Break Apart to get the same (transformed) shapes to split out.
Flatten won't work for a multiple selection or group as it tries to flatten to visible paths.
If the 1st scenario works, I might be able to loop it on canvas.
Okay
Forget flatten.
I have bodged this together:
https://gitlab.com/inklinea/dbus-flatten
It seems to work most of the time :)
I should add that it does convert shapes ( rect / circle / ellipse etc ) to path if they are flattened.
@inklinea sounds good. Will your tool deal with clones or gradients?
It won't work with clones, as it converts to path first :(
However if you have a sequence that you know works with clones, It could be replicated ( maybe )
It won't work with clones, as it converts to path first :(
However if you have a sequence that you know works with clones, It could be replicated ( maybe )
I think it would only work for translate to be converted to x, y as cannot covert rotate / scale without changing the path - and then it would not be a clone :)
@inklinea Understood. Yes, dealing with translate (on clones) would be useful.
Off-topic question: Is it possible to replicate a process that involves boolean operations combined with lattice deformation?
Would need to see an example sequence (workflow ) that you use to see if I can replicate it :)
@inklinea OK. As it is a bit off topic. I'll DM you in RocketChat. Also thank you for looking into the transforms issues. :)
I've replaced the above with this:
https://gitlab.com/inklinea/ink_flatten
Hi, I just want to put a post in here because I may need to reference this in the near future. I am just about to work on an animation where the background is 1.3mb already, which may not sound a lot, but by the time i get into 200 or 300 or 400 frames, the file size may rise dramatically.
It might be worth posting the problems you are having.
A step by step process of what you do, or want to do.
With a sample file to show.
Hi, no probs as yet, I just wanted to mark this thread for later reference. I haven't fully explored 1.3 yet and I was unaware of the path->flatten. I try to keep my projects small because my workhorse is an old Win7 2.2ghz laptop, although if need be, I do have a desktop I can use but that is not so much in my creative space . I am in the process of doing a series of short advertising gif animations; the first was 45 secs. I am now on the second one and the static background of scene 2 is 1.2 MB, so, assuming I end up with something in the order of 300-400 frames, that might be in the order of a 300+ MB file assuming my predictive math is correct. I am going to start drawing the animated part either tomorrow or the day after, and that is when the compacting might be required, cheers Sean.