Metadata-Version: 2.1
Name: pizzoo
Version: 0.9.2
Summary: Pizzoo is a library for rendering on pixel matrix screens, with direct support for the Divoom Pixoo64 device, and easy integration for any other one. It includes full animation buffer manipulation, a micro game engine, as well as XML/HTML like templates compilation.
Home-page: https://github.com/pabletos/pizzoo#readme
Author: Pablo Huet
License: MIT
Keywords: pixoo,pixoo64,divoom,screen,pixel,matrix,render,buffer,LED matrix,LED,raspberry,raspberry pi
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Multimedia :: Graphics
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
Requires-Dist: requests~=2.31.0
Requires-Dist: Pillow~=10.0.0
Requires-Dist: bdfparser~=2.2.0

<p align="center">
  <img src="https://github.com/pabletos/pizzoo/blob/main/docs/docs/assets/images/pizzoo-banner-nobg.png" alt="Pizzoo logo" width="450">
</p>
<p>
	<a 
	href='https://ko-fi.com/B0B1PYK0W'
	target='_blank'
	rel="noreferrer"
	>
	<img height='24' style="border:0px; height:24px" src='https://img.shields.io/badge/donate-blue?logo=ko-fi&logoColor=%23ffffff' border='0' alt='Buy Me a Coffee at ko-fi.com' />
	</a>
	<a
	href='https://pypi.org/project/pizzoo/'
	target='_blank'
	rel="noreferrer"
	>
	<img height='24' style="text-decoration:none;" src="https://img.shields.io/badge/version-0.9.0-blue?logo=pypi&logoColor=%23ffffff"/>
	</a>
	</a>
	<img height='24' style="text-decoration:none;" src="https://img.shields.io/badge/status-beta-yellow"/>
</p>

Pizzoo is a robust Python library designed for developers who want to unlock the full potential of matrix LED displays, particularly the Pixoo64, a 64x64 pixel LED display, and extend its functionalities to various other devices. Whether you're looking to create dynamic animations, develop interactive games, or integrate unique display functionalities, Pizzoo provides you with the tools and flexibility to innovate and express your creative ideas.

## Features

* **Full Animation Creation and Control**:
	With frame-by-frame programatic drawing capabilities you can craft detailed animations directly on your LED display, allowing you to visually conceptualize, iterate, and render animations seamlessly.

* **Template Rendering**:
	Our built-in compiler supports an XML/HTML-like language for template processing. This facilitates the design of UIs with relative positioning, defined areas, and reusable components, helping you creating fast and reusable interfaces.

* **Flexible integration with any device**:
	The Renderer class can be easily extended to support additional methods and integrate with various hardware. This ensures that Pizzoo can adapt to your specific project and hardware requirements.

* **Game Development Toolkit**:
	Tap into the possibilities of micro game development with our mini game engine. Design, develop, and deploy small-scale games that can be played right on your LED devices, perfect for creating engaging interactive experiences.

## Drawing on your device
Frame manipulation is the core of the `pizzoo` library. Every time the library is created and the `render` method is called, the buffer is filled with a new frame we can use to draw on. Lets start by drawing three pixels on the screen and rendering:

<img align="right" width="160" height="160" src="https://github.com/pabletos/pizzoo/blob/main/docs/docs/assets/images/qs-2.png">

```python
pizzoo.cls()
pizzoo.draw_circle((31, 31), 10, '#00ff00', filled=True) # Green circle, filled
pizzoo.draw_rectangle((26, 26), 11, 11, '#ff0000', filled=False) # Red rectangle, not filled
pizzoo.draw_line((31, 0), (31, 63), '#0000ff') # Blue line
pizzoo.draw_line((0, 31), (63, 31), (255, 255, 0)) # Yellow line, tuple rgb color format
pizzoo.render()
```

## Creating animations
Aside from simple gif drawing (That is also supported), custom animations can be created using frame-by-frame manipulation. As an example:

<img align="right" width="160" height="160" src="https://github.com/pabletos/pizzoo/blob/main/docs/docs/assets/images/qs-5.gif">

```python
'''
This will create a simple diagonal moving circle
'''
for i in range(0, 54):
	pizzoo.cls()
	pizzoo.draw_circle((i + 4, i + 4), 2, '#00ff00', filled=True)
	pizzoo.add_frame()
pizzoo.render(frame_speed=100)
```

## Rendering templates
The most powerful feature of this library is the ability of render templates. Custom XML/HTML like templates can be made to create images, Pixoo64 dials and even reusable parts or components.

<img align="right" width="160" height="160" src="https://github.com/pabletos/pizzoo/blob/main/docs/docs/assets/images/qs-6.png">

```python
'''
This template uses custom nodes for Pixoo64 for creating auto-updating dials, as date or time, so these are missing when 
rendering on any other renderer
'''
pizzoo.load_font('amstrad', './files/amstrad_cpc_extended.bdf')
pizzoo.render_template('''
	<pizzoo>
		<rectangle x="0" y="0" width="100%" height="100%" color="8" filled="true">
			<section x="0" y="2">
				<date format="DD" x="1" color="#ffc107" font="small"></date>
				<text x="9" color="#ffc107">-</text>
				<date format="MM" x="13" color="#ffc107" font="small"></date>
				<time format="HH:mm" x="26" font="small"></time>
				<date format="WWW" width="63" x="50" color="#ffc107" font="small"></date>
			</section>
			<section x="5" y="10" width="53" height="43">
				<rectangle x="0" y="0" width="100%" height="100%" color="#FFFFFF" filled="true" />
				<section x="1" y="1" width="51" height="51">
					<text x="0" y="0" color="#000000" wrap="true">Long text wrapped</text>
					<text x="10" y="80%" shadow="diagonal" color="#FF0000" font="amstrad">Cool</text>
					<image x="17" y="40%" src="./files/test_image.png" />
				</section>
			</section>
		</rectangle>
	</pizzoo>
''')
```

There's also have a dedicated section for this on our docs.

## Do you want to know more?
[Here's](pizzoo.pablohuet.com) a dedicated page for documentation with a lot of examples so you can get quickly started.

## Contribute and/or donate
This library was created and is maintained by a single developer, consider contributing with pull requests, new integrations, proposals or [simply by doing a small donation on ko-fi](https://ko-fi.com/B0B1PYK0W).

## Special thanks
This library exists thanks to other libraries that were an inspiration, specially the [Pixoo](https://github.com/SomethingWithComputers/pixoo) library by SomethingWithComputers and the [Matrix-Fonts](https://github.com/trip5/Matrix-Fonts/tree/main) matrix bdf font collection by trip5.
