Write bitmap files (.bmp) in pure Python.
This is a very simple script to write .bmp files. You can easily drop it in a repository and use it for your project.
The following code sample shows the full interface of the Bitmap class.
from bitmap import Bitmap
# Create a bitmap 10px by 10px with a grey background.
bmp = Bitmap(10, 10, fill=(51, 51, 51))
# Draw a diagonal blue line.
for i in range(8):
bmp.pencil(i + 1, i + 1, (0, 100, 255))
# Save the file.
bmp.save('diag_blue_line.bmp')
A few simple things to keep in mind: