Giter VIP home page Giter VIP logo

Comments (5)

Zulko avatar Zulko commented on August 28, 2024

The gif writing is slow because ImageMagick is slow. If you want something much faster, you can use ffmpeg by using clip.write_gif("myanimation.gif", program="ffmpeg"), your gif will be even bigger in size, but it will be generated very fast, so it's useful for previewing, and when you are happy with the result you remove program="ffmpeg" and it will generate the gif with ImageMagick.

If you want a smaller size, use ImageMagick, but then it's more an art than a science, here is what you can do: (1) reduce the fps. Movies can have up to 30fps which is way too much for a gif. Try clip.write_gif('test.gif', fps=15). (2) use the opt option. It can be opt=OptimizePlus or opt=OptimizeTransparency. It will tell ImageMagick to reduce the size of the GIF using some compression methods. (3) if you have a clip with very few colors, provide colors=3. Note that for many colors like colors=256 the algorithm can be superslow.

from moviepy.

abirafdirp avatar abirafdirp commented on August 28, 2024

thanks very much... sorry for me being lazy didn't read the write_gif documentation..
where do i put the color parameter though?

from moviepy.

Zulko avatar Zulko commented on August 28, 2024

in write_gif. I am closing the issue (as it seems to be solved) but if you have more questions you can still ask them in this thread.

from moviepy.

abirafdirp avatar abirafdirp commented on August 28, 2024

it gives me error if I put it in write_gif, reading the documentation there is no color parameter too

from moviepy.

Zulko avatar Zulko commented on August 28, 2024

Strange. But this parameter is only here since the very last version (on github). Forget about it for now, it's not tested anyway.

from moviepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.