Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

A curses-based pixel art tool.

Project description


A curses-based pixel art tool.

More correctly, painterm is a actually a scriptable bitmap image editor which also provides a curses-based command line interface.


Painterm requires Python 3.5. If you already have that, installation is as: `sh pip3 install painterm `

or cloning this repository and running: `sh python3.5 install `


Once installed, the painterm command will run the application. The applicatiion provides 4 function:

  • new: Create a new image
  • load: Load an existing image
  • bmp: Export to a .BMP file
  • pxon: Export to a .PXON file


  • up, down, left, right: Move the cursor
  • space: Draw a pixel at the current location
  • f: Flood fill at the current location
  • z: Undo the most recent draw (persists across sessions)
  • Z: Redo the most recent undone draw (persists across sessions)
  • 1-9: switch to the nth-most-recently-used colour
  • [ABCDEFHIKLMNORST][abcdefhiklmnorst] change colour to selected palette colour (e.g., At will switch to a white).
  • d: switch to the colour under the cursor
  • s: Toggle snail mode (moving the cursor will cause it to draw first)
  • q: Quit painterm

Painterm saves automatically, so don’t worry about it.


The heart of the painterm library is the Image class (found in painterm.image). It represents a bitmap image as an sqlite3 database. New images can be created using: `python image = Image.new_image(width, height) `

This will load a new image into an in-memory database (the path argument can be used to pass a pathlib.Path to save the database to). This file can later be loaded using Image.load

By default, the image will have a transparent-white background, but an alternative can be set using the background keyword. Colours in painterm are supplied as a four-tuple of (red, green, blue, alpha), where red, green, and blue are integers between 0 and 255, and alpha is a floating point number between 0 and 1. When returning colours, painterm will actually return the painterm.colour.Colour namedtuple.

Image provides two drawing methods: draw, and fill. Both take x, the 0-indexed horizontal coordinate, y, the 0-indexed vertical coordinate, and colour, an rgba 4-tuple.

Reading of pixels can be done using the colour_at method, which takes x and y as arguments, and returns the colour as a namedtuple.

The image can be resized using the resize method. If new pixels are added, they will be given the initial background colour. If pixels are removed, their history will be removed with them.

undo, redo exist and will step back or forward one transaction (probably, one call to draw, or fill, although both methods take an argument continue_transaction to allow multiple actions to be taken as one).

Images can currently be exported to either a BMP (using the export_bitmap method), or PXON (using the export_pxon method). There is not currently a way to import image files.


Painterm is provided under the Mozilla Public License 2.0

Project details

Release history Release notifications

This version
History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
painterm-0.1.0.tar.gz (13.2 kB) Copy SHA256 hash SHA256 Source None Nov 1, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page