I'm using ImageMagick-7.0.6-Q16 on windows 10 via command line
I currently use a bat file I created to convert PNG sequences into GIFs while resizing and adding a text watermark in the process. It works fine, though in some cases I want to have the starting frame to be different (frame 25 for example) than frame 0, but still loop completely.
i.e. GIF start on 25f play through the end to frame 90 then continue 1 to 24 and loop.
my current solution has been batch renaming the files to choose the starting frame but then I have to alter all the provided frames and it's quite time consuming.
Ideally I'd like to have a way to set in the bat file the starting frame for the GIF and still loop through all provided images from the png sequence.
Is this possible?
choose starting frame (different than frame 0) for a GIF
-
- Posts: 2
- Joined: 2018-08-25T00:15:48-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: choose starting frame (different than frame 0) for a GIF
I don't think GIF has any metadata that tells viewers to start displaying from some frame other than zero.
snibgo's IM pages: im.snibgo.com
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: choose starting frame (different than frame 0) for a GIF
If you can set your desired starting frame number as a variable or an argument to your script, you can easily re-order the images when you read them into the "magick" command.svarturvalko wrote: ↑2018-08-25T00:33:05-07:00Ideally I'd like to have a way to set in the bat file the starting frame for the GIF and still loop through all provided images from the png sequence.
Code: Select all
set FRAME1=7
magick *.png ( -clone 0-%FRAME1% ) -delete 0-%FRAME1% +insert <other stuff...> output.gif
-
- Posts: 2
- Joined: 2018-08-25T00:15:48-07:00
- Authentication code: 1152
Re: choose starting frame (different than frame 0) for a GIF
my knowledge on the command is very basic but currently am using this on my bat file.
convert +repage -fuzz 3.0%% -delay 3 -loop 0 *.png -layers OptimizePlus -layers OptimizeTransparency output.gif
Assuming my sequence si 90 frames and I wan it to start at frame 7 how would you adapt your code into mine?
sorry for maybe a simple answer, I tried in multiple ways to incorporate what you wrote but can't make it work. Also I always used convert, didn't know I can use "magick"
convert +repage -fuzz 3.0%% -delay 3 -loop 0 *.png -layers OptimizePlus -layers OptimizeTransparency output.gif
Assuming my sequence si 90 frames and I wan it to start at frame 7 how would you adapt your code into mine?
sorry for maybe a simple answer, I tried in multiple ways to incorporate what you wrote but can't make it work. Also I always used convert, didn't know I can use "magick"
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: choose starting frame (different than frame 0) for a GIF
The "( -clone 0-7 ) -delete 0-7 +insert" part of my example should be right after your command reads in the images...svarturvalko wrote: ↑2018-08-27T01:18:28-07:00Assuming my sequence si 90 frames and I wan it to start at frame 7 how would you adapt your code into mine?
Code: Select all
magick ... *.png ( -clone 0-7 ) -delete 0-7 +insert ... output.gif
If your starting frame number will change from one run to another, you can set a variable ahead of the command and use it in the two places where I used the "7".
With IM7 you should be using "magick ...", "magick montage ...", "magick mogrify ...", etc.Also I always used convert, didn't know I can use "magick"