Hi All
I have done a few Google searches but didn't come up with quite what I want, so I'm hoping there is someone out there that can point me in the right direction.
I am making some animations, probably in a long winded way, but for now that is all I know and I have limited time in which to do it. I have drawn every frame on a different layer, with the first layer being the background. Initially I exported to gif by switching on the first (background) layer and the layer of the frame that I want exported and then doing the export. Then I discovered the inkscape command line and with a script I can now export several layers one after another. However, I have not figured out how to export two layers to one gif so I have had to copy the background to each layer.
For the export I use the following command line instruction in my script:
inkscape --export-png=${1}-${i}.png --export-id=${i} --export-id-only --export-dpi=400 --export-area-page --export-background-opacity=1 ${1}.svg
However, this off course will only export the layer with an object id of ${i}. (I number my layers in starting at 001 and incrementing by 1 so that I can loop in a script).
Is there a way of more than one layer so that I can export layer 000 (the background) and another layer so that I don't have to copy the background onto each layer.
Any help would be greatly appreciated.
Kind Regards Jannetta
=================================== Web site: http://www.jannetta.com Email: jannetta@...2761... ===================================
On Sat, 2010-10-02 at 09:50 +0100, Jannetta Steyn wrote:
Is there a way of more than one layer so that I can export layer 000 (the background) and another layer so that I don't have to copy the background onto each layer.
You could manipulate the SVG file between rendering, toggling the visibility states of the layers (leaving the background layer visible).
The layer name, here "000" appears as inkscape:label="000" in the file, and will be followed by style="display:none"> if the layer is hidden.
Or you export each single layer and then use another tool for compositing. Easiest might be ImageMagick:
for f in layers/*.png; do composite layers/background.png $f composited/${f##*/}; done
Assuming you have single layer exports in a folder "layers" including a "background.png", want results in "composited" and use the script from within the parent folder.
Note that I don't know anymore how I arrived at the "${f##*/}".
On 2/10/10 10:50, Jannetta Steyn wrote:
I am making some animations, probably in a long winded way, but for now that is all I know and I have limited time in which to do it. I have drawn every frame on a different layer, with the first layer being the background. Initially I exported to gif by switching on the first (background) layer and the layer of the frame that I want exported and then doing the export. Then I discovered the inkscape command line and with a script I can now export several layers one after another. However, I have not figured out how to export two layers to one gif so I have had to copy the background to each layer.
For the export I use the following command line instruction in my script:
inkscape --export-png=${1}-${i}.png --export-id=${i} --export-id-only --export-dpi=400 --export-area-page --export-background-opacity=1 ${1}.svg
However, this off course will only export the layer with an object id of ${i}. (I number my layers in starting at 001 and incrementing by 1 so that I can loop in a script).
Is there a way of more than one layer so that I can export layer 000 (the background) and another layer so that I don't have to copy the background onto each layer.
Have you tried putting the background objects on the root layer (always visible, accessible via XML Editor), and export using '--export-id' but omitting '--export-id-only' so that the visible background elements below the selected layer are rendered into the exported bitmap as well?
~suv (admits not having tested it locally)
p.s. Maybe you are also interested in a new extension (work-in-progress): https://code.google.com/p/inkscape-animation-extension/ http://www.inkscapeforum.com/viewtopic.php?f=11&t=6019&p=25434
On 2/10/10 12:04, ~suv wrote:
On 2/10/10 10:50, Jannetta Steyn wrote:
Have you tried putting the background objects on the root layer (always visible, accessible via XML Editor), and export using '--export-id' but omitting '--export-id-only' so that the visible background elements below the selected layer are rendered into the exported bitmap as well?
*embarrassed* scrap that - you'd still need to toggle the layer visibility in-between.
Another thought: take look at the export options of JessyInk (part of Inkscape 0.48 [1]) and the python script it is based on. Maybe you can reuse it to create your own export extension? JessyInk also uses a global background layer (for the presentation).
~suv
[1] JessyInk Homepage http://code.google.com/p/jessyink/ Exporting: http://code.google.com/p/jessyink/wiki/Export
On 02/10/10 12:11, ~suv wrote:
On 2/10/10 12:04, ~suv wrote:
On 2/10/10 10:50, Jannetta Steyn wrote:
Have you tried putting the background objects on the root layer (always visible, accessible via XML Editor), and export using '--export-id' but omitting '--export-id-only' so that the visible background elements below the selected layer are rendered into the exported bitmap as well?
*embarrassed* scrap that - you'd still need to toggle the layer visibility in-between.
Another thought: take look at the export options of JessyInk (part of Inkscape 0.48 [1]) and the python script it is based on. Maybe you can reuse it to create your own export extension? JessyInk also uses a global background layer (for the presentation).
~suv
[1] JessyInk Homepage http://code.google.com/p/jessyink/ Exporting: http://code.google.com/p/jessyink/wiki/Export
Hi Jannetta:
If I understand your question correctly, JessyInk should pretty much exactly do what you need.
The following steps should get you the result you want: 1) Install JessyInk in your image [1]. 2) Set your background slide [2]. 3) Export your image (for reasons explained on the wiki page, this is a two stage process) [3].
Should you have any problems, feel free to contact me. Alternatively, as ~suv mentioned, it should be fairly easy to modify the JessyInk export extension to suit your needs.
Cheers, Hannes
[1] Installation http://code.google.com/p/jessyink/wiki/Installation (If your are using Inkscape 0.48 you can directly jump to the last step. [2] Master slide http://code.google.com/p/jessyink/wiki/masterSlide [3] Exporting http://code.google.com/p/jessyink/wiki/Export (as ~suv mentioned)
participants (4)
-
Hannes Hochreiner
-
Jannetta Steyn
-
Thorsten Wilms
-
~suv