Post Reply 

Merging Photograph and gif

Mar 8, 2014, 18:42 (This post was last modified: Mar 8, 2014 18:42 by kylerickards.)
Post: #1
Merging Photograph and gif
Hi all

I am trying to add a gif of fire, onto a still picture but I cannot work out how to do it.

I have tried duplicating my original base image and then copying it on top of each gif frame, and I also tried altering the opacity of the gif files and my base image but still no joy - is anyone able to help me please?

Many thanks in advance
Kyle
Find all posts by this user
Quote this message in a reply
Mar 8, 2014, 21:15 (This post was last modified: Mar 8, 2014 21:17 by ofnuts.)
Post: #2
RE: Merging Photograph and gif
Assuming the fire frame has a transparent background, you need to interleave a copy of the fixed image between every frame of the fire then merge the fire frame on the later below. There are scripts for this. Google for "Gimp Animstack" or use my own interleave-layers.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 9, 2014, 11:08
Post: #3
RE: Merging Photograph and gif
(Mar 8, 2014 21:15)ofnuts Wrote:  Assuming the fire frame has a transparent background, you need to interleave a copy of the fixed image between every frame of the fire then merge the fire frame on the later below. There are scripts for this. Google for "Gimp Animstack" or use my own interleave-layers.

I don't think the fire has a transparent background Sad

I did try your script but managed to confuse myself as to how to apply it

Kyle

PS) Thanks for getting back to me
Find all posts by this user
Quote this message in a reply
Mar 9, 2014, 13:12
Post: #4
RE: Merging Photograph and gif
(Mar 9, 2014 11:08)kylerickards Wrote:  [quote='ofnuts' pid='26248' dateline='1394313358']
I don't think the fire has a transparent background Sad

Then either find another one with a transparent background, or extract the one you have from its background. See here for the proper technique (set you GIF to RGB First using >Image>Mode>RGB). This is quite simple on an individual layer, but a bit tedious if you have to repeat it on 40 frames. Save as XCF for next step.

(Mar 9, 2014 11:08)kylerickards Wrote:  I did try your script but managed to confuse myself as to how to apply it

One possible way once you have a animation with the backrgound removed (GIF or XCF):
  • open the background image
  • Duplicate the image (>Image>Duplicate) and work on the duplicate
  • >File>Open as layers and pick the flame image (with background removed of course)
  • Link together the loaded layers (shift-click on any layer, which will link all layers, and then unlink the ones you don't want (background))(if you don't know how to link, see here).
  • Use the Move tool to position the flame layers (since you have linked them, just drag one and the others will follow)
  • Remove the background layer
  • Start the script (the sprite mode version) and;
    • Layer: the layer from your original image
    • Opacity: 100%
    • Mode: Normal
    • Merge: yes
This will create a third image

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 9, 2014, 14:46
Post: #5
RE: Merging Photograph and gif
(Mar 9, 2014 13:12)ofnuts Wrote:  
(Mar 9, 2014 11:08)kylerickards Wrote:  [quote='ofnuts' pid='26248' dateline='1394313358']
I don't think the fire has a transparent background Sad

Then either find another one with a transparent background, or extract the one you have from its background. See here for the proper technique (set you GIF to RGB First using >Image>Mode>RGB). This is quite simple on an individual layer, but a bit tedious if you have to repeat it on 40 frames. Save as XCF for next step.

(Mar 9, 2014 11:08)kylerickards Wrote:  I did try your script but managed to confuse myself as to how to apply it

One possible way once you have a animation with the backrgound removed (GIF or XCF):
  • open the background image
  • Duplicate the image (>Image>Duplicate) and work on the duplicate
  • >File>Open as layers and pick the flame image (with background removed of course)
  • Link together the loaded layers (shift-click on any layer, which will link all layers, and then unlink the ones you don't want (background))(if you don't know how to link, see here).
  • Use the Move tool to position the flame layers (since you have linked them, just drag one and the others will follow)
  • Remove the background layer
  • Start the script (the sprite mode version) and;
    • Layer: the layer from your original image
    • Opacity: 100%
    • Mode: Normal
    • Merge: yes
This will create a third image

Thanks for the help, I think I am nearly there, but I can't find how to run the script now. I saved it as a .py file and put it into usr/lib/gimp/2.0/python folder but can't find it now?

Kyle
Find all posts by this user
Quote this message in a reply
Mar 9, 2014, 15:28 (This post was last modified: Mar 9, 2014 15:29 by ofnuts.)
Post: #6
RE: Merging Photograph and gif
1) The good place is in ~/.gimp-2.8/plug-ins (your Gimp profile)

2) Make sure it's executable (chmod +x or through some properties dialog in the file explorer)

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 9, 2014, 19:27
Post: #7
RE: Merging Photograph and gif
(Mar 9, 2014 15:28)ofnuts Wrote:  1) The good place is in ~/.gimp-2.8/plug-ins (your Gimp profile)

2) Make sure it's executable (chmod +x or through some properties dialog in the file explorer)

Hi

I have put the file into the correct plug in's folder and set it as executable but I still can't see which menu I should be looking in to run it?

Sorry again if these are daft questions...

Kyle
Find all posts by this user
Quote this message in a reply
Mar 9, 2014, 20:01 (This post was last modified: Mar 9, 2014 20:05 by ofnuts.)
Post: #8
RE: Merging Photograph and gif
It should be around the bottom of the 'Image' menu.

You can find the plugins using the >Help>Plugin browser:

[attachment=3165]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 10, 2014, 17:01
Post: #9
RE: Merging Photograph and gif
Thank you!

That's exactly what I wanted!

Owe you one!

Kyle
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  gif making tybonel13 1 232 May 27, 2017 16:17
Last Post: ofnuts
  Help with adding image to gif Mandzukic 2 338 Sep 18, 2014 19:21
Last Post: Mandzukic
  Animated Gif? Captain_Cereal_Hands 4 419 Jun 29, 2014 18:00
Last Post: iForStyle007
  Animated Gif with a fixed layer RickiTickiToc 4 461 May 30, 2014 13:25
Last Post: ofnuts
  Merging pictures in GIMP MartinT 2 394 May 19, 2014 14:34
Last Post: fanina

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS