Ask Your Question

How to read gif in python ?

asked 2018-03-03 06:43:20 -0500

Nbb gravatar image

updated 2018-03-03 06:44:09 -0500

How do I read a gif in opencv python ? I tried imread but it is reading nothing. It is in the same directory as my code.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-03 07:06:19 -0500

berak gravatar image

you can't using imread() , there's no codec for that builtin (still a license problem)

you can abuse VideoCapture (works, because ffmpeg can read gif's) , or you'll have to fallback to 3rd party libs like PIL

edit flag offensive delete link more



thank you very much ! VideoCapture works nicely

Nbb gravatar imageNbb ( 2018-03-03 07:33:50 -0500 )edit

Question Tools

1 follower


Asked: 2018-03-03 06:43:20 -0500

Seen: 10,285 times

Last updated: Mar 03 '18