It is currently Thu Apr 25, 2024 3:16 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: A script (python) to merge numerous gif files together
PostPosted: Wed Jun 28, 2017 11:25 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 198
After placing this script

Attachment:
shuffle-and-merge-files.zip [2.01 KiB]
Downloaded 589 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

Attachment:
Asteroid.gif
Asteroid.gif [ 461.84 KiB | Viewed 7708 times ]


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: A script (python) to merge numerous gif files together
PostPosted: Wed Jun 28, 2017 11:30 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 198
The three .xcf files

Attachment:
Asteroid.xcf [796.96 KiB]
Downloaded 317 times

Attachment:
Planet.xcf [689.73 KiB]
Downloaded 304 times

Attachment:
Background.xcf [2.46 MiB]
Downloaded 302 times


Top
 Post subject: Re: A script (python) to merge numerous gif files together
PostPosted: Wed Jun 28, 2017 12:18 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
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.


Top
 Post subject: Re: A script (python) to merge numerous gif files together
PostPosted: Wed Jun 28, 2017 4:39 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1333
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.


Top
 Post subject: Re: A script (python) to merge numerous gif files together
PostPosted: Thu Jun 29, 2017 1:40 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 198
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


Top
 Post subject: Re: A script (python) to merge numerous gif files together
PostPosted: Wed Jul 05, 2017 10:27 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Apr 09, 2016
Posts: 580
Location: Sheffield UK
I'm only just beginning to learn how to animate, the script works fine, thankyou very much. :tyspin

_________________
Image


Top
 Post subject: Re: A script (python) to merge numerous gif files together
PostPosted: Thu Jul 06, 2017 2:00 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 198
Thankyou RJKD :) and good luck with your animations


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Automate merge of multiple files horizontally

3

No new posts Attachment(s) My first Python Script for Gimp

7

No new posts .py script not showing under Python-Fu

3

No new posts Attachment(s) Learning to do first Python script

6

No new posts Does anyone have script fu and python plugins that work on 2.99.19?

1



* Login  



Powered by phpBB3 © phpBB Group