elsonwx / webp2gif Goto Github PK
View Code? Open in Web Editor NEWconvert animated webp to gif
convert animated webp to gif
The script runs and finishes but no output and no errors!
And tried different files with same result
Here is a sample:
[user@localhost]$ ./webp2gif T01.webp t01.gif
Extracting webp frames...
Saved file 1.webp (5790 bytes)
Decoded 1.webp. Dimensions: 512 x 512 . Format: lossy. Now saving...
Saved file 1.png
Saved file 2.webp (5844 bytes)
Decoded 2.webp. Dimensions: 512 x 512 . Format: lossy. Now saving...
Saved file 2.png
Saved file 3.webp (5812 bytes)
Decoded 3.webp. Dimensions: 512 x 512 . Format: lossy. Now saving...
Saved file 3.png
Saved file 4.webp (5894 bytes)
Decoded 4.webp. Dimensions: 512 x 512 . Format: lossy. Now saving...
Saved file 4.png
[it keeps on ........etc]
Saved file 185.webp (3928 bytes)
Decoded 185.webp. Dimensions: 512 x 512 . Format: lossy. Now saving...
Saved file 185.png
Saved file 186.webp (3902 bytes)
Decoded 186.webp. Dimensions: 512 x 512 . Format: lossy. Now saving...
Saved file 186.png
[user@localhost]$
After debugging it stops at the rename
step
rename 's/(\d+)/sprintf("%03d",$1)/e' *.png
It doesn't rename or complain and also stops the script at this step. I even added the verbose parameter -v
but still not errors shown!
was easy enough to fix with "brew install rename" but maybe you could list it as dependency as well
$ ../webp2gif audible1.webp audible1.gif
ERROR: Too many arguments for '-info'.
ERROR: No action specified.
Exiting due to command-line parsing error.
ERROR at 'folder/untitled': Multiple input files specified.
Exiting due to command-line parsing error.
Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT
webpmux -set SET_OPTIONS INPUT -o OUTPUT
webpmux -duration DURATION_OPTIONS [-duration ...]
INPUT -o OUTPUT
webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT
webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]
[-bgcolor BACKGROUND_COLOR] -o OUTPUT
webpmux -info INPUT
webpmux [-h|-help]
webpmux -version
GET_OPTIONS:
Extract relevant data:
icc get ICC profile
exif get EXIF metadata
xmp get XMP metadata
frame n get nth frame
SET_OPTIONS:
Set color profile/metadata:
icc file.icc set ICC profile
exif file.exif set EXIF metadata
xmp file.xmp set XMP metadata
where: 'file.icc' contains the ICC profile to be set,
'file.exif' contains the EXIF metadata to be set
'file.xmp' contains the XMP metadata to be set
DURATION_OPTIONS:
Set duration of selected frames:
duration set duration for each frames
duration,frame set duration of a particular frame
duration,start,end set duration of frames in the
interval [start,end])
where: 'duration' is the duration in milliseconds
'start' is the start frame index
'end' is the inclusive end frame index
The special 'end' value '0' means: last frame.
STRIP_OPTIONS:
Strip color profile/metadata:
icc strip ICC profile
exif strip EXIF metadata
xmp strip XMP metadata
FRAME_OPTIONS(i):
Create animation:
file_i +di+[xi+yi[+mi[bi]]]
where: 'file_i' is the i'th animation frame (WebP format),
'di' is the pause duration before next frame,
'xi','yi' specify the image offset for this frame,
'mi' is the dispose method for this frame (0 or 1),
'bi' is the blending method for this frame (+b or -b)
LOOP_COUNT:
Number of times to repeat the animation.
Valid range is 0 to 65535 [Default: 0 (infinite)].
BACKGROUND_COLOR:
Background color of the canvas.
A,R,G,B
where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying
the Alpha, Red, Green and Blue component values respectively
[Default: 255,255,255,255]
INPUT & OUTPUT are in WebP format.
Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be
valid.
cannot open input file '1.webp'
convert-im6.q16: unable to open image `1.png': No such file or directory @ error/blob.c/OpenBlob/2701.
convert-im6.q16: no images defined `1.png' @ error/convert.c/ConvertImageCommand/3258.
converting all png frame file to gif...
convert-im6.q16: unable to open image `*.png': No such file or directory @ error/blob.c/OpenBlob/2701.
convert-im6.q16: no images defined `animation.gif' @ error/convert.c/ConvertImageCommand/3258.
mv: target 'folder/audible1.gif' is not a directory
finished with success!
See for instance:
https://mathiasbynens.be/demo/animated-webp
webpmux -info shows that two frames have x/yoffsets... and after running your script,
the resulting image is broken
the solution is complicated. It would mean parsing the full webpmux -info output, and using graphicsmagick to properly offset frames that require it.
when i run ./webp2gif aaa.webp
, i get error,here are.
Failed to create mux object
your script just hadle 20 frames , it's not good,
my repositorie have fixed it.
哦。。武汉的……你只处理了20帧,我做了一些优化。看下代码咯
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.