This guide doesn’t cover all changes in 0.3. See also the full list of changes in Version 0.3.0.

Wand finally becomes to support Python 3, the future of Python. It actually doesn’t cover all Python 3 versions, but the most two recent versions, 3.2 and 3.3, are supported. We still support Python 2.6, 2.7, and PyPy as well, so there’s no dropped compatibility.

Wand now adds supports to sequential images like animated image/gif images and image/ico images that contains multiple icons. To distinguish between each single image and the container image, newly introduced class SingleImage has been added. The most of operations and properties are commonly available for both types, Image and SingleImage , and these are defined by their common superclass, BaseImage .

So every Image object now has sequence attribute which is list-like. It implements collections.MutableSequence protocol. That means you can pass it into for statement, get an item by index from it, slice it, call len() for it, or del an item of it by index. Every item inside it is a SingleImage instance.

The following example shows you how to determine the largest icon in a image/ico file:

>>> from wand.image import Image >>> import urllib2 >>> with Image ( file = urllib2 . urlopen ( 'https://github.com/favicon.ico' )) as ico : ... max ( ico . sequence , key = lambda i : i . width * i . height ) ... <wand.sequence.SingleImage: 80d158d (32x32)>

This feature was initially proposed by Michael Elovskikh (#34), and then he also did initial work on this (#39). Andrey Antukh then improved its API (#66). Bear Dong and Taeho Kim did additional efforts for issues related to animated image/gif images (#88, #103, #112).

See also the guide for sequence as well: Sequence.