Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Edit gif
#1
Hello !

First of all, sorry for my bad english, I'm not a native speaker.

I'm trying to edit each layer of my gif, found on internet (erase a part of the gif with an eraser) but I don't want to do the same thing for each layer, there are a lot and it's not very precise (and it doesn't work, anyway).

Can you help me ?

Thanks !
Reply
#2
I don't think you can get the different layers of a .gif if it has been flattened. I just opened 3 and only one opened with layers in Gimp.
Ofnuts has many scripts/pythons, so may have one to help you.

Smile
Reply
#3
@Luciole
Really need more information. Is the area you need to erase in the same position all the time or does it move around ?

If it moves around, not much you can do except work each layer individually.

If the position is fixed it might be possible to overlay the area with a remade background.

Quote:...(erase a part of the gif with an eraser) but I don't want to do the same thing for each layer, there are a lot and it's not very precise (and it doesn't work, anyway)...

First thing to try is Filters -> Animation -> Unoptimise which makes a new animation with complete layers.
Next for any editing is Image -> Mode -> RGB that gets more colours available.

If possible post a screenshot of the animation and the part that is erased.
Reply
#4
(05-01-2022, 12:25 PM)rich2005 Wrote: @Luciole
Really need more information.  Is the area you need to erase in the same position all the time or does it move around ?
.........//........
If possible post a screenshot of the animation and the part that is erased.
@Luciole
Indeed more info is needed
Also I would rather prefer a link to the gif as you said you've downloaded it from the internet.
Reply
#5
Thanks for your anwsers, all three !

Sorry, indeed, there is a lack of information ! I have an example with that gif : https://zupimages.net/up/22/17/bvcf.gif
Okey, there is just a few layers (33) but it's still a good example.
I want to erase some sparkles, not the totality, just a little at the bottom.

I tried a layer mask on the first layer then, I tried a layer group to apply the same effect on the rest of the layers (32). Also, I tried to erase stupidly, with the eraser, without a layer mask. But it doesn't work. I think the transparency doesn't work on the gif, is it true ?

Here is a screenshot :

https://www.zupimages.net/up/22/17/0cuc.png

I erased without a layer mask, and I wanted to use layer group to apply the same effect.

On that screenshot, I forgot to do that : Filters -> Animation -> Unoptimise
Maybe it's the reason, I don't know.

Thanks for your help !
Reply
#6
The example animation is not optimised and is already in RGB mode ?  but for any other, check those first.

To erase an area as your example screenshot, one way is using two scripts (1) sg-combine-bg.scm to paint in the area for erase, (2) c2a-all-layers.scm to erase a color.

The procedure is
Make a layer at the bottom of the stack with a color as the area for erase. Use the pencil tool for hard edges, no anti-aliasing.
Apply Filters > Animation > Overlay Background (script 1) Then delete the bottom layer.
Apply Image > color-to-alpha-All-layers (script 2) Colour pick the painted in color and OK to remove the color.

That is your intention so far. You could of course just use (1) to paint over in black without that transparent hole
or
To fill in the hole, another layer at the bottom then Filters > Animation > Combine Background (another part of script 1)

Sorry this is English commentary but you might get the idea https://youtu.be/EG42e_TPVI0

If it is something else, give details.

Two scripts attached. Unzip, put in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\scripts


Attached Files
.zip   two-scripts.zip (Size: 1.9 KB / Downloads: 124)
Reply
#7
An idea:
Create a new transparent layer.
Bearing in mind which parts you want to remove, paint with the brush on this transparent layer over the equivalent areas of the other layers that you want to remove.
Then use the ofn-interleave-layers.py plugin

The painted transparent layer will be overlaid on top of all the layers of the gif (and merged to each one)
[Image: CtDMdYc.png]

Watching the rich2005 video from the previous post I realized that using Filters-Animation-Overlay background makes the idea I proposed even simpler.
The video also served to remind me of other useful plugins that I didn't even remember anymore.
Thank you rich2005!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#8
Put the mask on the group itself!

Create a group, drag n drop your gif directly inside the group in the layer's dialog/stack from your desktop or any other location using your window manager/explorer of your system
Then on the group itself create the mask

   

the .xcf for you to see

.xcf   Untitled.xcf (Size: 296.14 KB / Downloads: 100)
Reply
#9
Unfortunately, you can not do that for an animation. You need some way of applying the mask to all layers in the group, then devolve the layer group into layers outside the group for the animation.

Do you know of a simple way ?

It is the transparency shown by the OP screenshot which is a problem. Several ways of blanking out part of each layer, the Saule Goode script, Ofnuts has a clear-layers.py plugin which applies the BG colour to a selection in all layers. Bound to be others, but so far I have not seen a cut-selection on all layers script.

Edit: Ofnuts clear-layers.py plugin does work. That example animation did not have alpha on all layers. Another plugin such as multiple-layer-actions required Wink  Looks like it will be the easiest way.  http://sourceforge.net/projects/gimp-too...s/scripts/    near the bottom of the list clear-layers-0.2.py dated 2012-03-12
There is a alpha-to-all-layers script here: http://gimpchat.com/viewtopic.php?f=9&t=1718#p21494


Ah... It is an ancient script but it does all that is required. Add alpha to all layers then cut a selection. I like scripts for very occasional use, I can load them without restarting Gimp.  Mupltiple-Layer_Actions.scm zipped and attached

Works like this 30 second demo: https://i.imgur.com/vda1Oa5.mp4


Attached Files
.zip   Multiple-Layer-Actions.zip (Size: 2.65 KB / Downloads: 104)
Reply
#10
(05-02-2022, 08:29 AM)rich2005 Wrote: Unfortunately, you can not do that for an animation. You need some way of applying the mask to all layers in the group, then devolve the layer group into layers outside the group for the animation.

You're right! even webp does not work as intended, I don't know why I was sure there were a right click to apply the mask on the group to all layers in that group, BUT no right click to do it Cry

(05-02-2022, 08:29 AM)rich2005 Wrote: Do you know of a simple way ?

I might have found a simple way with the saulgoode's script ➤ http://chiselapp.com/user/saulgoode/repo...combine-bg
.7z   sg-combine-bg.scm.7z (Size: 1.23 KB / Downloads: 139)
At the bottom make a selection on a transparent layer, fill with black ➤ put that layer in Erase mode ➤ then Filters ➤ Animation ➤ _Overlay background
With the saulgoode's script no question/popup/option asked, it just run and do the job.

   

I have also the script you show on the video, that's also a nice and quick solution with options, that's a nice one as well  Smile
Reply


Forum Jump: