Image Processing, In Python?

PythonImageImage ProcessingImage Manipulation

Python Problem Overview


I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what?

Python Solutions


Solution 1 - Python

The best-known library is http://effbot.org/zone/pil-index.htm">PIL</a>;. However if you are simply doing basic manipulation, you are probably better off with the Python bindings for http://wiki.python.org/moin/ImageMagick">ImageMagick</a>;, which will be a good deal more efficient than writing the transforms in Python.

Solution 2 - Python

Depending on what you mean by "image processing", a better choice might be in the numpy based libraries: mahotas, scikits.image, or scipy.ndimage. All of these work based on numpy arrays, so you can mix and match functions from one library and another.

I started the website http://pythonvision.org which has more information on these.

Solution 3 - Python

You also have an approach to image processing based on "standard" scientific modules: SciPy has a whole package dedicated to image processing: scipy.ndimage. Scipy is in effect the standard general numerical calculations package; it is based on the de facto standard array-manipulation module NumPy: images can also be manipulated as array of numbers. As for image display, Matplotlib (also part of the "science trilogy") makes displaying images quite simple.

SciPy is still actively maintained, so it's a good investment for the future. Furthermore, SciPy currently runs with Python 3 too, while the Python Imaging Library (PIL) does not.

Solution 4 - Python

Solution 5 - Python

There's also http://www.cairographics.org/pycairo/">pycairo</a>;, which might be more suitable depending on your needs.

Solution 6 - Python

There is actually a wonderful Python Imaging Library (PIL). It gives you the ability to alter existing images, including anti-aliasing capabilities, and create new images with text and such. You can also find a decent introductory tutorial in the PIL handbook provided on the aforementioned site.

Solution 7 - Python

If you are creating a custom image processing effect, you may find PythonPixels useful. http://halfhourhacks.blogspot.com/2008/03/pythonpixels.html It is intended for writing and experimenting with image processing.

Solution 8 - Python

VIPS should be fast and uses multiple CPUs:

https://github.com/libvips/libvips/wiki/Speed-and-memory-use

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionakdomView Question on Stackoverflow
Solution 1 - PythonJimView Answer on Stackoverflow
Solution 2 - PythonluispedroView Answer on Stackoverflow
Solution 3 - PythonEric O LebigotView Answer on Stackoverflow
Solution 4 - PythonPiti OngmongkolkulView Answer on Stackoverflow
Solution 5 - PythonsgrahamView Answer on Stackoverflow
Solution 6 - PythonakdomView Answer on Stackoverflow
Solution 7 - PythonmoltenformView Answer on Stackoverflow
Solution 8 - PythonguettliView Answer on Stackoverflow