background preloader

Python Imaging Library (PIL)

Python Imaging Library (PIL)
The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities. Status The current free version is PIL 1.1.7. Support Free Support: If you don't have a support contract, please send your question to the Python Image SIG mailing list. You can join the Image SIG via python.org's subscription page, or by sending a mail to image-sig-request@python.org. You can also ask on the Python mailing list, python-list@python.org, or the newsgroup comp.lang.python. Downloads The following downloads are currently available: Additional downloads may be found here. For a full list of changes in this release, see this page. If the Windows installer cannot find a Python interpreter, you may have to register your interpreter. For a full list of changes in this release, see this page. Related:  Python Image ProcessingPythonPython

Python Morphology Toolbox Pymorph is a collection of pure python implementations of many image morphology functions. Mahotas Pymorph is still available and bug-free, but I am not adding any new features. It started small, but now has almost all of the functionality of pymorph and a lot of functionality that pymorph did not have. Additionally, mahotas has functionality that pymorph never had (nor will have). Download & Install You can use easy_install or pip:: easy_install pymorph pip install pymorph If you want the code, it can be downloaded as a source tar.gz file from pypi. python setup.py install Documentation Autogenerated API Docs are very complete. The book Hands-On Morphological Image Processing provides some of the background, but is based on the older release. Releases Since there is feature stability, I release on PyPI whenever I have fixed a new bug (to make it easy for people who use easy_install or pip to keep up). Support The official forum for discussion of pymorph issues is the pythonvision mailing list.

ronnix/fabtools - GitHub Switch-case statement in Python « The ByteBaker This post is part of the Powerful Python series where I talk about features of the Python language that make the programmer’s job easier. The Powerful Python page contains links to more articles as well as a list of future articles. In the months since this was written, I have received a number of comments and learned more about programming languages in general. A switch-case statement is a useful programming language that lets you control the flow of the program based on the value of a variable or expression. Based on the value of the variable n, a different message will show up on the standard output. The switch-case statement comes in handy when you’re writing a language parser like I am now. Unfortunately, my language of choice for the time being is Python, which doesn’t come with a typical switch-case statement. It certainly works and should be pretty easy to work, but it’s not a very elegant solution. The Pythonic solution is to make use of Python’s powerful dictionaries.

pymorph The pymorph Morphology Toolbox for Python is a powerful collection of latest state-of-the-art gray-scale morphological tools that can be applied to image segmentation, non-linear filtering, pattern recognition and image analysis. The pymorph Morphology Toolbox is an open source software for Morphological Image Analysis and Signal Processing written in Python. It is a companion resource for the book: Hands-on Morphological Image Processing , by Edward Dougherty and Roberto Lotufo, published by SPIE, Aug 2003, ISBN=0-8194-4720-X. From its preface: "The book is hands-on in a very real sense. As the fuctions are written in pure Python, some functions are not very efficient and may take very long to process. The images used in the book together with the python scripts to build most of the figures that illustrate the book are available here: toolbox handson.

virtualenvwrapper 2.9 — virtualenvwrapper v2.9 documentation virtualenvwrapper is a set of extensions to Ian Bicking’s virtualenv tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. Features¶ Organizes all of your virtual environments in one place.Wrappers for managing your virtual environments (create, delete, copy).Use a single command to switch between environments.Tab completion for commands that take a virtual environment as argument.User-configurable hooks for all operations (see Per-User Customization).Plugin system for more creating sharable extensions (see Extending Virtualenvwrapper). Introduction¶ The best way to explain the features virtualenvwrapper gives you is to show it in use. First, some initialization steps. Now we can install some software into the environment. We can see the new package with lssitepackages: Support¶ Shell Aliases¶ License¶

How to edit an image Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}. Acredita-se que este artigo ainda seja válido no contexto original (quando ele foi escrito) Overview This article describes how to manipulate images in PySymbian. Code snippet import appuifw, e32from graphics import * #Define the exit function:app_lock=e32.Ao_lock()def quit():app_lock.signal()appuifw.app.exit_key_handler=quit #We open the imageimg=Image.open("C:\\i.jpg") #We can see its current sizeprint img.size #Now we resize it:img=img.resize((240,240), keepaspect=0)#The target size is a tuple containing the new dimensions in pixles#keepaspect is optional. Postconditions Here is the result for the example above: The initial image The resulting image See also: How to add a text to an image

PyGPU Haven't you ever dreamt of writing code in a very high level language and have that code execute at speeds rivaling that of lower-level languages? PyGPU is a compiler that lets you write image processing programs in Python that execute on the graphics processing unit (GPU) present in modern graphics cards. This enables image processing algorithms to take advantage of the performance of the GPU. Existing methods for programming the GPU uses either specialised languages (such as Cg, HLSL, or GLSL) or an embedded language in C++ (Sh) or C# (Accelerator). The embedded approaches admit a higher level of abstraction (being embedded in somewhat higher level languages) and also does away with a lot of the glue code necessary with using specialised languages. PyGPU is an embedded language in Python, that allow most of Python features (list-comprehensions, higher-order functions, iterators) to be used for constructing GPU algorithms. News Papers Examples Download and installation Download links NumPy

a crossplatform framework for creating NUI applications Understanding Python's "with" statement Fredrik Lundh | October 2006 | Originally posted to online.effbot.org Judging from comp.lang.python and other forums, Python 2.5’s new with statement (dead link) seems to be a bit confusing even for experienced Python programmers. As most other things in Python, the with statement is actually very simple, once you understand the problem it’s trying to solve. Consider this piece of code: set things up try: do something finally: tear things down Here, “set things up” could be opening a file, or acquiring some sort of external resource, and “tear things down” would then be closing the file, or releasing or removing the resource. If you do this a lot, it would be quite convenient if you could put the “set things up” and “tear things down” code in a library function, to make it easy to reuse. def controlled_execution(callback): set things up try: callback(thing) finally: tear things down def my_function(thing): do something controlled_execution(my_function) This wasn’t very difficult, was it?

scikit-learn "We use scikit-learn to support leading-edge basic research [...]" "I think it's the most well-designed ML package I've seen so far." "scikit-learn's ease-of-use, performance and overall variety of algorithms implemented has proved invaluable [...]." "For these tasks, we relied on the excellent scikit-learn package for Python." "The great benefit of scikit-learn is its fast learning curve [...]" "It allows us to do AWesome stuff we would not otherwise accomplish" "scikit-learn makes doing advanced analysis in Python accessible to anyone."

Related: