For programmers familiar with python or matlab who are interested in toying with the sounds and images around them; for artists, designers, and composers seeking a deeper understanding of the numerical systems that underlie modern media production.

numm is a minimalist media library that translates popular sound, image, and video formats to and from numpy arrays. By coercing inputs into common modes (eg. sample rate, bit depth), combining and mutating these numpy arrays is greatly simplified.

The general strategy for these functions is to make any assumptions necessary such that a single array of numbers provides sufficient information with which to reconstruct a media file, without any additional metadata. For example, width and height are contained in the dimensions of an array, so they may be different image to image, but framerate, samplerate, &c is not inherent to the data, so it should be made uniform unless explicitly specified.

In the transition from an image to an array, the primary considerations are resolution (wxh) and mode (RGB, RGBA, 8bit, 16bit, &c). We choose not to provide any special API for resampling an Image--this can be done with numpy if desired--and always return 8bit RGB buffers.

np2image(np, path)

In the case of audio, we choose to force all input to 44100Hz stereo.

np2sound(np, path)

Video is an array of wxhx3 arrays 30frames per second. Square pixels are assumed.

np2video(np, path)

Note that in particular in the case of video, these numpy buffers will require a considerable amount of memory; preprocess accordingly (eg in ffmpeg). We should also raise a NotEnoughMemory exception when RAM will not hold our buffer.

The live interface is provided by, a function with just a few input-output controls, communicated through function passing.




Debian/Ubuntu: 1. sudo apt-get install python-numm

Mac OSX:

  1. Install PIL % easy_install pip % pip install PIL
  2. Install Homebrew
  3. Add some extra "formulas"

    curl -o $(brew --prefix)/Library/Formula/pycairo.rb \ curl -o $(brew --prefix)/Library/Formula/pygobject.rb curl -o $(brew --prefix)/Library/Formula/pygtk.rb \ curl -o $(brew --prefix)/Library/Formula/gst-python.rb


  1. brew install opencv gst-python gst-plugins-good gst-plugins-ugly
  2. Install numm!


  1. Download and install the 32-bit version of Python 2.6
  2. Install the Python Imaging library
  3. Install PyGTK from the all-in-one installer
  4. Install an old version of Gstreamer from OSSBuilds (GStreamer-WinBuilds-GPL-x86.msi & GStreamer-WinBuilds-SDK-GPL-x86.msi) is promising, but I couldn't get it to work
  5. Download and install the Numpy Superpack
  6. Download OpenCV extract to C:& get your hands dirty in the registry (I set both PATH and PYTHONPATH here)
  7. Install numm!


Copyright (C) 2011-2012, Dafydd Harries
Copyright (C) 2011-2012, Robert Ochshorn

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

git clone git://