5

Using this code mogrify -format gif *.webp that I found in another forum https://superuser.com/questions/1506337/batch-convert-webp-files-to-gif-files-offline/1506428 to convert a webp file, to an animated gif...

I was wondering if anyone else experienced patches of black and/or white "dropouts", when using this method? With many files, it works without incident, but with others, such as the attached, I have to use an online converter, to avoid this issue. Are there additional filters that I could apply, or other CLI methods for this type of conversion?

result with dropouts

LOlliffe
  • 1,647
  • 5
  • 22
  • 43
  • What is your ImageMagick version and platform/OS? If IM 7 (HDRI), try adding -clamp to your command line. – fmw42 Jan 30 '20 at 01:59
  • I'm using: Version: ImageMagick 6.9.10-83 Q16 x86_64 2020-01-10 https://imagemagick.org Copyright: © 1999-2020 ImageMagick Studio LLC on OSX 10.11.6 – LOlliffe Jan 30 '20 at 21:06
  • Can you post an input frame that looked normal after the conversion and an input frame that comes out with the white regions. Or better zip your input files and post to some free hosting service such as dropbox.com and put the URL here. Are you using the latest webp library? – fmw42 Jan 30 '20 at 22:04
  • I don't have access to the files, so found a new one. In the zip file, is the original webp file, a version with dropouts, created with mogrify, a version from an online conversion with the same type of dropout results from ezgif, and 2 that converted properly from zamzar and convertio - https://www.dropbox.com/transfer/AAAAAETHAQDi4hEk5PET9EgtFUbWT02gn745wAdwjr0u5ghKSS31DEs I'm using the version listed above, which is the latest available on MacPorts. – LOlliffe Jan 30 '20 at 23:54

1 Answers1

6

Some of your webp frames have transparency and others do not. The fix seems to be to set the dispose method to none. So this works for me on IM 6.9.10.90 Q16 Mac OSX Sierra using convert. I suggest you use the more flexible convert rather than mogrify. I am not sure you can do what you want with mogrify as it wants one output per one input. Here is my command:

convert -delay 10 -dispose none tumblr_e573d6d767dd3d65d21de47fa7d16d13_4d26286c_400.webp -loop 0 animation.gif


or better

convert -delay 10 -dispose none tumblr_e573d6d767dd3d65d21de47fa7d16d13_4d26286c_400.webp -coalesce -loop 0 -layers optimize animation.gif


Give that a try and let me know if it works for you. The file is too large to upload directly. If you need to see it and my command does not work for you, then I will post it elsewhere and put a link here.

fmw42
  • 46,825
  • 10
  • 62
  • 80
  • Thanks for switching me over to `convert`. The `mogrify` command is simpler, but obviously wasn't the right way to go, at least not without some tweak that I couldn't find. – LOlliffe Jan 31 '20 at 06:39
  • 3
    `convert: data encoding scheme is not supported` for imagemagick 7.0.8.68 , doesn't seem to work for animated images – Harshiv Jul 12 '20 at 04:09
  • As far as I know, ImageMagick does not support animated webp. – fmw42 Jul 12 '20 at 06:57