pygraphics
๐ Area Bounding Boxes
Every shape and text primitive returns an Area(x, y, w, h) bounding box for partial screen refresh and dirty-rect updates.
๐ค Embedded Romfonts
Zero-dependency built-in 8x8, 8x14, and 8x16 romfonts with arbitrary scaling, transparency, and external .bin file support.
๐ผ๏ธ Streaming BMP565
Stream and slice massive 16-bit RGB565 bitmaps without loading full images into microcontroller RAM.
โก Hardware Blit Fast-Paths
Direct SPI/SDL bulk blit dispatch with clipping context managers (with draw.clip(...)).
๐ป Live Interactive 2D Drawing Demo
Try editing the drawing primitives below and click โถ Run to execute them with direct MicroPython WebAssembly:
๐ Quick Install
| Distribution | Channel | Role |
|---|---|---|
pydevices-pygraphics |
TestPyPI | Native C-extension wheel for desktop, Android, and CPython (native_cmod) |
pygraphics |
MIP | Pure-Python package for microcontrollers and builds without a C compiler (pygraphics_python) |
# CPython / Desktop
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pydevices-pygraphics
๐ฎ Featured Browser Demos
Explore complete applications and arcade games built with pygraphics:
๐ด Bouncing Balls
High-framerate physics simulation with vector circles and bounding-box collision detection.
๐พ Alien Arcade
Retro Space Invaders-style sprite engine with transparency and animated framebuffers.
๐ฆ Dino Runner
Classic obstacle jumping arcade running with dirty scanline refresh and physics.
๐น๏ธ Testris Arcade
Full-featured falling-blocks game with matrix rotation, score tracking, and ghost pieces.
๐ Documentation Map
- ๐ Getting started โ Core drawing workflows, dirty rectangles, and canvases.
- ๐ฆ Installation โ MIP, TestPyPI, wheel building, and platform matrix.
- ๐จ Graphics guide โ FrameBuffer vs Draw, clipping stacks, fonts, and blit fast-paths.
- ๐ผ๏ธ Graphics files โ BMP565, PBM, PGM image loaders and streaming.
- โก Benchmarks โ Native C extension vs Pure-Python performance metrics.
- ๐ API Reference โ Full autogenerated API documentation.