I have two gifs: aura.gif
which is a 7 frames animation, and character.gif
which is a 1 frame image. When I overlay one on top of the other as shown below, I get a 7 frames animated image but the character in character.gif
only appears in the first frame.
How can I duplicate character 7 times so that when I overlay it over the aura the character shows in all 7 frames?
I cannot make character.gif
animated from the start.
require 'vips'
character = File.open("character_no_animation.gif").read
character_b = Vips::Image.new_from_buffer(character, "", access: 'sequential', n: -1)
aura = File.open("aura.gif").read
aura_b = Vips::Image.new_from_buffer(aura, "", access: 'sequential', n: -1)
aura_b.composite(character_b, "over", x: 0, y: 0).gifsave("composite.gif")