Skip to content

einekatze/image_processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image_processing

image_processing is an experiment in tinkering with images in Python 3 without making use of third-party libraries.

This project features a simple PNG encoder, as well as a class for tinkering with 32-bit RGBA images. Furthermore, primitive bitmap font rendering support is available through the Font class. The PNG encoder supports outputting APNG-specific chunks, so it can be used to generate animated PNGs as well.

image_processing is not a serious attempt at making an image processing library. That's why it only supports exporting one single kind of PNG image: 24-bit RGB without interlacing.

Example application

This project comes with an example application, example.py. Run it to generate an image at out/test.png.

Creating images for use with image_processing

To create an image that be get used by Canvas' load_rgb_data or load_rgba_data methods, use GIMP.

Open an image file with GIMP, then choose "Export As..." in the File menu. Open up the collapsible "Select File Type" list and select "Raw image data". Then, export the image with RGB Save Type "Standard (R,G,B)".

Make sure that the image you are exporting does not contain an alpha channel when you plan to use load_rgb_data, and conversely, make sure an alpha channel exists when using load_rgba_data. Furthermore, make sure that the image is not indexed.

Due to the lack of any metadata in this format, your Canvas must be initialized with the correct width and height. Implementing PPM support would fix this issue.

Attribution

The mig68000 font used in this package was created by Marc Russell.

About

An experiment in processing images without external libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages