(01-13-2023, 12:50 AM)Lee Wrote: I have two files, animated.gif and image.png and I want to make a gif that combines the two. The image.png is larger than the gif and I want the gif in the middle. I tried copy paste and I only got one panel of the animated gif. I tried other things and then the image flashed with the gif.
Is it possible to put a gif in the middle of a static image? If so how?
Unless you do all by hand one-layer at a time you need a script to merge the background layer with each layer of the animation.
Open the background image first, then open as layers the animation file. That will plant the animation in the center of the background.
Some caveats to consider.
The animation first.
If it is optimized, un-optimize it. Filters -> Animation -> Unoptimize (edit - missed that typo )
For a gif change the color mode to RGB Image -> Mode -> RGB
If you want to do any editing, now is the time to do it.
Save this as a new file something.xcf (preferred) or export as a gif something.gif
Open the background layer. If it is indexed color, change that to RGB Not needed for a png.
Open as layers the animation and that puts it above the background layer.
To add the background to each layer use the attached script sg-combine-bg.scm (no need to resize the animation with this script). Make sure the background (bottom) layer is active and run the script. The background layer is now not needed and you can delete it.
Always Save your work as a Gimp .xcf in case you need to go back for more editing.
Export as a file.gif
Any number of YT videos on the subject. I am not proud, here is another:
https://youtu.be/FjnAmE-nd7U 4.5 minutes duration.
The attachment contains 2 scripts the sg-combine-bg.scm and a utility for removing a plain color background from the original animation (if needed) Unzip and put in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\scripts