Extracting Gimp Krita Photoshop layers in Natron Tutorial

Extracting Gimp Krita Photoshop layers in Natron Tutorial


Nice, this save a lot of time :slight_smile:

Can this be done for ReadSVG also? Let me know if modifications to the OFX plugin are needed.

1 Like

The lines are not strait and the backdrop don’t cover all the nodes (no big deal), but works :slight_smile:

1 Like

Will try to get SVG working. Probably need some rewrite. This one is getting the layer data from read node (imagelayer/layer) property. SVG read seems to be empty.

BTW, can you see if a TIFF layered image can work with shuffle? In my machine shuffle can’t detect TIFF layers.

1 Like

Backdrop fixed. Thanks. :slight_smile:

1 Like

The layer option in ReadPSD is a legacy option from before all the readers moved to multiplane.

Adding a Shuffle node after the reader will fix this (then you can take the available layers from that), then you could make one Python script to read any “layers” from readers that support it (EXR/XCF/PSD/KRA/SVG etc).


rootShuffle = app.createNode('net.sf.openfx.ShufflePlugin')
rootShuffle.connectInput(0, currentNode)
layersList = rootShuffle.getParam('outputLayer').getOptions()
1 Like

Thanks for hint. Will examine the code.

A small warning, I extracted a SVG (can be any format) that had 50 or so objects/layers, and the shuffle nodes seems to want to cache the output for each node or something, so I ran out of RAM and Natron was killed by the OS.

I have several projects with more layers that works fine (I do however use merge, not shuffle), odd …

It’s the preview in the actual node, it does not honor (or release?) the memory/cache settings and will run until out of RAM.

Should thumbnail be off then?

I would recommend that, if you have many layers it will eat up all the RAM.

1 Like

Alright will do it by today. Thanks!

So far this is the code. I have two questions though:

  1. Can you please see Line no. 63-69? I had to do hard code here. My main concern is line 69 strings. Is there any built-in list we can use here?
  2. Is it possible to delete the rootshuffle node after op? I coudn’t find any del/remove function in API.


extractPSDLayers.py (4.4 KB)

I couldn’t find any either, seems like it was never implemented(?).

Hmm, then this is it for now. Thanks for your help. :slight_smile:


Since this was the only feature I used from the natron-python-scripting repo I decided to make my own version in a separate repo, mostly an excuse to do some Python scripting (something I never do).

1 Like