Switch to full style
Post your GIMP animations here
Post a reply

A script (python) to merge numerous gif files together

Wed Jun 28, 2017 11:25 am

After placing this script

shuffle-and-merge-files.zip
(2.01 KiB) Downloaded 591 times

in your python plugin folder, open gimp. The script can be found at "<Image>/Layer/Stack shuffle and merge layers"

Open two or more .xcf files
Run the Stack and shuffle layers script, it stacks, shuffles and merges layers copied from all open Image files to create a new file, which can then be viewed as an animation in gimp or saved as a gif file

Important

1. The order in which images are opened is important, near objects in the image are opened first, the background image is opened last
2. There must be an equal number of layers in each open image
3. The computer may seem to hang if numerous images with many layers are merged, if the layers dialogue is kept open the shuffling can be seen and a guess to how long it will take can be made

Less important

The Images can be a mix of, RGB, Grayscale or Indexed
The Images can be of differing width or height

I've uploaded the three .xcf files in the next post which i ran the script on to create the gif shown below, I think it would be easier to practise on them than read a rambling explanation by me

steve

Asteroid.gif
Asteroid.gif (461.84 KiB) Viewed 7850 times

Re: A script (python) to merge numerous gif files together

Wed Jun 28, 2017 11:30 am

The three .xcf files

Asteroid.xcf
(796.96 KiB) Downloaded 320 times

Planet.xcf
(689.73 KiB) Downloaded 310 times

Background.xcf
(2.46 MiB) Downloaded 304 times

Re: A script (python) to merge numerous gif files together

Wed Jun 28, 2017 12:18 pm

Reminds me bit of Animation Merge script except it uses only 2 images. Practised with your examples first and some brush images.
Works fine, thank You Steve.

Re: A script (python) to merge numerous gif files together

Wed Jun 28, 2017 4:39 pm

Appreciate the script Steve. It will be interesting to see it work with the animation merge script as Nidhogg mentioned as well as with circular or 'infinite' animations.

Re: A script (python) to merge numerous gif files together

Thu Jun 29, 2017 1:40 am

Thanks Nidhogg, due to my recent switching from scheme to python I'd put this script on the back burner, but was inspired by Wills Animation Merge script to try again, and incorporated his mode merge and offset layers ideas into my script. In truth there are a few other script writers coding ideas in there as well, when I hit a problem I seek out and study other coders scripts to find a solution.

Thanks Tas_mania, my main hope at the moment is the script works or doesn't crash, I'm relatively new to python so the script may have coding errors that haven't manifested themselves yet or didn't show up when I tested it, fingers crossed

Re: A script (python) to merge numerous gif files together

Wed Jul 05, 2017 10:27 am

I'm only just beginning to learn how to animate, the script works fine, thankyou very much. :tyspin

Re: A script (python) to merge numerous gif files together

Thu Jul 06, 2017 2:00 am

Thankyou RJKD :) and good luck with your animations
Post a reply