Skip to main content

A library for image file manipulation, focused on data corruption and glitch effects.

Project description

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().

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 is 0.01.

Example Here's a simple Python script to use pyglitch:

import pyglitch

input_image = 'path/to/your/image.jpg' output_image = 'path/to/save/glitched_image.jpg'

Glitch the image with a 2% corruption level

pyglitch.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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyglitch-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyglitch-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pyglitch-0.1.0.tar.gz.

File metadata

  • Download URL: pyglitch-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pyglitch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fa4f56267026f5676e90688f236fa71bcdfa5d26dc4fdc53c43b6598e5e10090
MD5 628d7b73df73eeed92723a6c828aed78
BLAKE2b-256 27e7ab76a1cf9eb242fc5a1dfd887e305148973940fe17a34db2b865477a721e

See more details on using hashes here.

File details

Details for the file pyglitch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyglitch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pyglitch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e50d64a127b799135867b04b269856690e4929ad05807a160c9d3b52a8bedf
MD5 2eaef64e8a4cb5c9cfc007ac8a03c30e
BLAKE2b-256 6ce0dfb454762a5607ff990c83811cacc186776db4dcf94fc9cbbba5efd13c09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page