PixelFudge is a Python library for doing weird things to images. Not your standard crop-resize-filter pipeline — more like “what if we sorted all the pixels by hue” or “what if we applied a cellular automaton to the color channels.”

Examples

from pixelfudge import load, sort_pixels, glitch, save

img = load("photo.jpg")

# Sort pixels by luminance within each row
sorted_img = sort_pixels(img, key="luminance", direction="horizontal")

# Apply data-bending artifacts
glitched = glitch(img, intensity=0.3, seed=42)

save(sorted_img, "output.png")

Available transforms

  • Pixel sorting — sort by hue, saturation, luminance, or brightness along rows or columns
  • Channel shifting — offset RGB channels independently
  • Glitch effects — simulate JPEG corruption and data-bending
  • Voronoi — partition the image into Voronoi cells based on random or feature-detected seed points
  • Dithering — Floyd-Steinberg, ordered, and random dithering with custom palettes

Design philosophy

Each transform is a pure function: image in, image out. No mutation, no side effects. This makes it easy to chain operations or build pipelines.

The library uses NumPy under the hood for performance but exposes a simple, high-level API. Most operations run in well under a second for typical image sizes.