Quote:Thankyou, but now my question is how to process single file into these scripts from command line. i meant to say what will be the command to run these files individually through ubuntu terminal.
You will not do it in a terminal, as I explained I am not a coder.
--------
Can you not follow the video ?
Oh well, because you are starting from a strange point
3 layers in your exmple. SB5_bg.png / inverted.png / "Background"
SB5_bg.png is not required, delete it
inverted png seems to be the mask but is smaller than the "Background" Scale it to size
Select -> All
Layer -> Scale to Selection (sg-scale-to-selection.scm) giving a mask layer the same size as the "Background"
Then to add layer masks
Duplicate the "Background" giving 3 layers Mask / "Background" copy / Background
Add the mask to all layers, Image -> Mask -> Copy Mask to layers (sg-copy-mask-to-layers.scm)
For your specification only the bottom two layers are required.
Delete the top layer.
For your specification the top layer has the mask applied
Toggle the visiblity of the bottom layer off
Make the top layer active
Apply the layer mask (sg-apply-layer-mask-to-all-layers.scm Only shown on the assumption you can actually make a script yourself. Otherwise manually it is a Layer -> Mask -> Apply layer mask)
That gives two layers as your second clip from PS, showing two layers, Background removed / Origin.
That closes this topic for me. If you get no replies here for fixing the script you posted, then go back to stackoverflow.com and ask there.