pyglitch A library for image file manipulation, focused on data corruption and glitch effects.
Introduction pyglitch is a simple yet powerful tool for creating artistic data corruption effects on image files. By directly manipulating the raw byte data of an image, this library produces unique and unpredictable "glitches" that can be used for digital art and creative projects.
The library supports popular image formats like JPEG and PNG by navigating their file headers and focusing corruption on the main image data.
Installation You can install pyglitch directly from PyPI (when published) or from a local source.
To install from a local source:
pip install .
The library has no external dependencies beyond Python's standard library.
Usage The main function you will use is glitch_img(). You can import it directly from the main package, as shown below.
glitch_img(image_path, output_path, corruption_level)
image_path: The path to the input image file (e.g., 'my_photo.jpg').
output_path: The path where the glitched image will be saved (e.g., 'glitched_photo.jpg').
corruption_level: (Optional) A float representing the percentage of the file's data to corrupt (e.g., 0.05 for 5%). The default value is 0.01.
Example Here is a simple Python script to use the pyglitch library:
from pyglitch import glitch_img
input_image = 'path/to/your/image.jpg' output_image = 'path/to/save/glitched_image.jpg'
Glitch the image with a 2% corruption level
glitch_img(input_image, output_image, corruption_level=0.02)
print(f"Glitched image saved to {output_image}")
Contributing pyglitch is an open-source project. If you have an idea for a new type of glitch effect or an improvement, please feel free to contribute!
License This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for pyglitch 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 | Provenance | Actions |
|---|---|---|---|---|
| pyglitch-0.1.1.tar.gz | 2.8 kB | Without provenance | Details for pyglitch-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyglitch-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyglitch-0.1.1-py3-none-any.whl |
Total release size: 5.7 kB
Release files / pyglitch-0.1.1.tar.gz
| Download URL | pyglitch-0.1.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9fa88d660ae0952fe0dc0df9d18f296cc74bf81a3e26b1dbc49d41fe5950a05
|
|
BLAKE2b-256 checksum How to use checksums |
8868e3af52517528fe02ff13830761a11eac9229c7e294187c6e1642697a8aae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pyglitch-0.1.1-py3-none-any.whl
| Download URL | pyglitch-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab6b149ee69310bb5b06d49fa9457b7ecb92b46e112f615c5f6558daa6b84155
|
|
BLAKE2b-256 checksum How to use checksums |
8fbce77607be4181abdda03d4cd33e02f8205009c7679e551963edbf63c03a1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for pyglitch 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.