pyxels


Namepyxels JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryPyxels 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.
upload_time2024-04-25 13:49:43
maintainerNone
docs_urlNone
authorDJ Stomp
requires_python<4.0,>=3.12
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

```bash
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.

```python
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](LICENSE) for more information.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyxels",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": null,
    "author": "DJ Stomp",
    "author_email": "85457381+djstompzone@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/06/e4/94db62287929b4b0bc0c730dad80729cfb4a5d46bd92d7515d11480793ca/pyxels-0.1.1.tar.gz",
    "platform": null,
    "description": "# Pyxels\n\nPyxels 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. \n\nPyxels is currently in early development, and may not yet be ready for general use.\n\n## Installation\n\nTo install Pyxels, you can use pip:\n\n```bash\npip install pyxels\n```\n\n## Usage\n\n### pyxels.RGB\n\nThe `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.\n\n```python\nfrom pyxels import RGB\n\n# Create a new RGB color\ncolor = RGB(255, 0, 0)\n\n# Add two RGB colors\nnew_color = color + RGB(0, 255, 0)\n\n# Blend two RGB colors\nblended_color = color.blend(new_color, 0.42)\n\n# Check if two RGB colors are equal\nprint(f\"The colors are {'equal' if color == new_color else 'not equal'}\")\n\n# Convert an RGB color to a hex string\nprint(color.to_hex())\n\n# Load an RGB color from a hex string\ncolor = RGB.from_hex(\"#C0FFEE\")\n\n# Set the least significant bit of each color channel\nother_color = RGB(254, 127, 63)\nother_color.set_lsb(RGB(1, 0, 1))\n\n# Get the least significant bit of each color channel\nlsb = other_color.get_lsb()\n\n# Bitwise XOR two RGB colors\nxor_color = color ^ new_color\n```\n\n## License\n\nPyxels is released under the MIT license. See [LICENSE](LICENSE) for more information.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "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.",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8af820907792292739fc6cebb66a8d521b2c4527961b67302b7bdc08981075d2",
                "md5": "31df62d163419c2040a242d68b96afb6",
                "sha256": "8a2825e9dfc63303c9163997d7c2ea7316322a87f4d857dcc6d790c654e88e84"
            },
            "downloads": -1,
            "filename": "pyxels-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "31df62d163419c2040a242d68b96afb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 4919,
            "upload_time": "2024-04-25T13:49:40",
            "upload_time_iso_8601": "2024-04-25T13:49:40.537661Z",
            "url": "https://files.pythonhosted.org/packages/8a/f8/20907792292739fc6cebb66a8d521b2c4527961b67302b7bdc08981075d2/pyxels-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06e494db62287929b4b0bc0c730dad80729cfb4a5d46bd92d7515d11480793ca",
                "md5": "3703fdd323f32366500a5801a9cd2941",
                "sha256": "0b94b81ba3eeb8fee47880675f6ddb830260a95708e61a15c0104cd0c7d7d71f"
            },
            "downloads": -1,
            "filename": "pyxels-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3703fdd323f32366500a5801a9cd2941",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 4436,
            "upload_time": "2024-04-25T13:49:43",
            "upload_time_iso_8601": "2024-04-25T13:49:43.006052Z",
            "url": "https://files.pythonhosted.org/packages/06/e4/94db62287929b4b0bc0c730dad80729cfb4a5d46bd92d7515d11480793ca/pyxels-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 13:49:43",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pyxels"
}
        
Elapsed time: 0.21715s