Pyxels
Pyxels is a low-level image data manipulation library for Python. It is designed to be fast and efficient, and to provide a simple interface for working with image data.
Pyxels is currently in early development, and may not yet be ready for general use.
Installation
To install Pyxels, you can use pip:
pip install pyxels
Usage
pyxels.RGB
The pyxels.RGB class represents a color in the RGB color space. It has three attributes: red, green, and blue, which are all integers between 0 and 255. It supports addition, subtraction, multiplication, and division with other pyxels.RGB instances, as well as comparison with other pyxels.RGB instances.
from pyxels import RGB
# Create a new RGB color
color = RGB(255, 0, 0)
# Add two RGB colors
new_color = color + RGB(0, 255, 0)
# Blend two RGB colors
blended_color = color.blend(new_color, 0.42)
# Check if two RGB colors are equal
print(f"The colors are {'equal' if color == new_color else 'not equal'}")
# Convert an RGB color to a hex string
print(color.to_hex())
# Load an RGB color from a hex string
color = RGB.from_hex("#C0FFEE")
# Set the least significant bit of each color channel
other_color = RGB(254, 127, 63)
other_color.set_lsb(RGB(1, 0, 1))
# Get the least significant bit of each color channel
lsb = other_color.get_lsb()
# Bitwise XOR two RGB colors
xor_color = color ^ new_color
License
Pyxels is released under the MIT license. See LICENSE for more information.
Metadata
Release files for pyxels 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyxels-0.1.1.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyxels-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / pyxels-0.1.1.tar.gz
| Download URL | pyxels-0.1.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b94b81ba3eeb8fee47880675f6ddb830260a95708e61a15c0104cd0c7d7d71f
|
|
BLAKE2b-256 checksum How to use checksums |
06e494db62287929b4b0bc0c730dad80729cfb4a5d46bd92d7515d11480793ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Release files / pyxels-0.1.1-py3-none-any.whl
| Download URL | pyxels-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a2825e9dfc63303c9163997d7c2ea7316322a87f4d857dcc6d790c654e88e84
|
|
BLAKE2b-256 checksum How to use checksums |
8af820907792292739fc6cebb66a8d521b2c4527961b67302b7bdc08981075d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|