Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combining gif image to static image help?
#1
Hey everyone, I need some help with something.


I have this image here: https://s11.postimg.org/d6talfl37/banner.png

And I have this gif image here of falling snow: https://68.media.tumblr.com/642db6d043ae...o1_500.gif

I'd like to place the gif image on the static image (on the right hand side), but I want the snow to be "blending" into the background. Like, I don't want the blackness behind the snow to show, I only want the snow effect. Like how an overlay would look.

But no matter what I do, I can't get this to work. I see a lot of people being able to achieve something like this but I have yet to learn. I tried duplicating the background and overlaying the gif into each one of the backgrounds but that didn't work.

What am I supposed to do?
Reply
#2
Not very complicated but still many pitfalls and hurdles:

1) your snow animation is "optimized", which means that each frame/layer is only the difference with the previous one. You can't work with that directly, use Filters>Animation>Unoptimize to recover one full image per frame

2) Your snow animation being a GIF, it works in a reduced-color mode (color-indexed) and many tools don't work on that mode. You have to put yoru image in full color mode: Image>Mode>RGB

3) To make the layers transparent, you use Colors>Color-to-Alpha on each layer to remove the black. 40 layers. I wrote myself a quick script. Still doable by hand (I'll have a coffee while you do this :Smile )(*)

4) To insert the animation snow on your banner you have to make 40 copies of the banner (40 layers), and merge one frame of you animation over each copy. I have a script for this: called interleave-layers. However this script requires that the background image (your banner) and the animation have exactly the same image size (otherwise it would ask you where you want the animation to be...). So some further preparation is necessary.

5) Your banner in 202 px high, the snow is 280px so you crop te snow image to 202px. Using the Crop tool(Crop), in the Tool options, select Fixed->Height, and enter "202" in the size field. Choose the part of the animation to keep.

6) Then we have to widen the snow animation to 1004px to fit the banner. Image>Canvas size, increase the width to 1004. At the bottom of the dialog, you can position the layers in the new canvas by dragging them. I shifted them to the right, so that they are more where the cat looks than on the cat itself. Also, select Resize layers: all layers (this extends your layers with transparency to make them cover the whole canvas).

7) I assume that you have successfully installed the "interleave-layers" script.

8) File>Open and open the banner image

9) Select again the snow image. Image>Interleave layers>Interleave single layer (sprite mode). In the "layer selector, choose the banner image. Keep the defaults for the rest. A new image is created, this is your animation. You can use Filter>Animation>Playback to test it.

10) To save it: File>Export and give a .GIF extension. Tick the Export as animation box.

11) You can also save a smaller file by using Filter>Animation>Optimize (for GIF) before exporting.

My results: https://www.dropbox.com/sh/sincyue22cyxz...SyhIa?dl=0

(*) Slightly faster: Set the bucket-fill too to "Color-erase" mode, set the foreground color to black, and bucket fill
each layer in turn. Even faster, grab the XCF in the shared folder above.
Reply
#3
Ofnuts beat me to it but not going to waste my effort Smile
------------
Nice Banner.

The images you have are different sizes and different color modes.

The black can be removed using Colors menu -> Color-to-Alpha one layer at a time but there is a script that will apply that to all layers in one go.

I used some third-party scripts. Unzip the attachment and put the 3 scripts in your Gimp profile C:\Users\your-name\.gimp-2.8\scripts folder

The procedure is:
Open the snow animation
1. Change the color mode to RGB from Indexed Image -> Mode -> RGB
2. Apply the Image -> color-to-alpha-all-layers script to remove the black
3. Change the canvas size Image -> Canvas size to suit the banner (1004x204),. Use the all layers option as well.
4. Add the banner to the bottom of the layer stack File -> Open-as-layers. Move to the bottom of the stack.
5. Apply the Combine Background script: Filters -> Animation -> Combine Background.
6. Remove the bottom (original banner) layer. Not needed anymore.

Do any more editing while still in RGB mode before exporting as an animated gif.

There is an alternative. A script that generates snow and will create the layers for an animation. That is in the zip as well.

A video demo of both ways 4 mins

sorry, I must have deleted it in a 'tidy-up'


Attached Files
.zip   Snow.zip (Size: 4.76 KB / Downloads: 252)
Reply


Forum Jump: