Skip to main content

Convert gif images to numpy images or to OpenCV without PIL or pillow. OpenCV does not support gif images.

Project description

# gif2numpy Python library to convert gif images to numpy images or to OpenCV without PIL or pillow. OpenCV does not support gif images.

Install it with

setup.py install

or with

pip install gif2numpy

# Usage

You can use the library this way:

from __future__ import print_function

import gif2numpy

import cv2

images = “Images/audrey.gif”, “Images/hopper.gif”, “Images/testcolors.gif”

for image in images:

np_image = gif2numpy.convert(image)

print(“type of image:”, image, type(np_image))

cv2.imshow(“np_image”, np_image)

cv2.waitKey()

There is also the class Gif inside the module which can be used to determine Gif features inside the image. This is just the first beta version of the module - no support on special gif features or much testing has been done yet.

# TO DO:

Write more convenient function wrappers to deliver the Gif features of an image.

# Dependencies

You need to install cv2 (opencv-python), numpy, kaitaistruct by:

pip install opencv-python numpy kaitaistruct

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gif2numpy-1.0.zip (7.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page