Skip to content

ptrgags/raster-tangles

Repository files navigation

Raster Tangles (2022, 2024)

tangles - The Raster Tangles Algorithm

Raster Tangles is an algorithm to generate pixel art doodles that mimic how I draw. See the Raster Tangles Guide for a full explanation.

Usage:

python -m tangles [OPTIONS] CONFIG_FILE OUTPUT_IMAGE

See Raster Tangles Config File for the JSON config file format.

pixelops - Pixel Art Utility Scripts

Bitcrush

This script takes a full-color image and reduces the color depth so only the most significant N bits of each color channel is kept. This can be used to create masks for Raster Tangles

Usage:

python -m pixelops bitcrush [OPTIONS] INPUT_IMAGE OUTPUT_IMAGE

Options:

Option Description
-n/--num-bits N How many bits to keep in each color channel (counting from the most significant bit). Defaults to 1

Upscale

This script scales up a pixel art image by an integer factor by repeating pixels.

Most image viewer programs use interpolation when displaying images, as this makes photos look nice. However, for pixel art, it makes everything look blurry. Upscaling a pixel art image helps minimize this problem.

Usage

python -m pixelops upscale INPUT_IMAGE OUTPUT_IMAGE SCALE_FACTOR

Example:

python -m pixelops upscale figures/stroke-fill-example.png figures/upscale-example.png 10
Original Zoom in (blurry) upscale output
original image original image zoomed in, which appears blurry

Grid

This script overlays a grid of black pixels on the image. I find this helpful for making cross-stitch patterns more readable. This works best on an upscaled image.

Usage:

python -m pixelops grid INPUT_IMAGE OUTPUT_IMAGE GRID_SPACING

Where GRID_SPACING is the integer number of pixels between each grid line.

Example:

python -m pixelops grid figures/upscale-example.png figures/grid-example.png 10

Example

About

Automatic tangle pattern generation using raster bitmasks (2022, 2024-2025)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages