Well, art is art, isn’t it? Still, on the other hand, water is water! And east is east and west is west, and if you take cranberries and stew them like applesauce, they taste much more like prunes than rhubarb does.
— Groucho Marx
Maybe you’re an artist, or a musician. Or maybe you just want to try something creative and different.
These first three appendices are explorations of some common human endeavors using Python. If your interest lies in any of these areas, you might get some ideas from the chapters, or the urge to try something new.
All computer languages have been applied to computer graphics to some degree. Many of the heavy-duty platforms in this chapter were written in C or C++ for speed, but added Python libraries for productivity. Let’s begin by looking at some 2-D imaging libraries.
Only a few graphics-related modules are in the standard library. Here are two of them:
If you downloaded the O’Reilly logo to a local file called oreilly.png, you could run this:
To do anything serious with graphics in Python, we need to get some third-party packages. Let’s see what’s out there.
For many years, the Python Image Library (PIL), although not in the standard library, has been Python’s best-known 2-D image processing ...