Francisco Passos
Francisco Passos

Reputation: 320

Manipulate WebP images in Python

I'm looking for something like PIL (Python Imaging Library), which sadly doesn't support WebP images.

I'd like to be able to do resizes and crops. Or at least convert to JPEG and then I can work it with PIL.

Upvotes: 15

Views: 11955

Answers (3)

Neon22
Neon22

Reputation: 648

This is a late post but the PIL (Pillow) module supports the webp image format.

The supported file formats and extra information about levels of support is here:

from PIL import Image
im = Image.open("foo.webp").convert("RGB")
im.save("foo.jpg", "jpeg")

Upvotes: 0

xamox
xamox

Reputation: 2779

Take a look at: http://code.google.com/p/python-webm/

I was able to walk through the test file to see how they were doing it.

Upvotes: 8

unutbu
unutbu

Reputation: 880329

imagemagick's convert tool, version 6.5.7-8 or better, can manipulate WebP images.

Also, Google provides an encoder and decoder for Linux, Windows and Mac OS X.

Upvotes: 4

Related Questions