-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextractGifFrame.cmd
More file actions
34 lines (28 loc) · 792 Bytes
/
extractGifFrame.cmd
File metadata and controls
34 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
echo ###################################################
echo # Description: Extract a specific frame from a GIF
echo # Usage: extractGifFrame.cmd image.gif 5
echo # Param 1: GIF file
echo # Param 2: Frame number to extract
echo # Requires: ImageMagick
echo ###################################################
echo.
REM Check parameters
IF "%~1"=="" (
echo Error: 1st arg must be a GIF file
exit /b 1
)
IF "%~2"=="" (
echo Error: 2nd arg must be the frame number to extract
exit /b 1
)
REM Get filename
set "filename=%~1"
set "frame=%~2"
set "outputFile=%~n1.frame-%frame%.png"
echo Extracting frame %frame% from %filename%
REM Do conversion
magick convert "%filename%[%frame%]" "%outputFile%"
REM Complete
echo Success: Extracted frame to:
echo # %outputFile%