Skip to main content

Convert images into Unknown Pleasures-style waveform art.

Project description

unknown-pixels

UnknownPixelsDemo 001

unknown-pixels is a simple Python command-line tool that transforms images into waveform art reminiscent of Joy Division's Unknown Pleasures album cover.

Unknown-pixels first converts the input image to grayscale, then (if necessary) it will pad the image along the smallest axis to make the image square. It then slices the image into nlines horizontal slices and renders each slice as a stylised "waveform", creating a unique visual representation of the original image.

Installation

Ensure you have Python 3.8 or higher installed. Then, install unknownpixels using pip:

pip install unknownpixels

Or clone the repo and run

pip install .

in the root of the repository to get the latest "development" version.

Usage

After installation, use the unknown-pixels command:

unknown-pixels --input path/to/image.jpg

This will process the input image and automatically show the waveform representation of the image.

Options

  • -i, --input: Path to the input image file. This image can be in any PIL-compatible format.
  • -o, --output: [Optional] Path to the output file. If not specified, the output will be saved to the same directory as the input file with a .png extension.
  • -n, --nlines: [Optional] Number of lines to render along the y-axis. Default is 50.
  • -f, --figsize: [Optional] Size of the figure to create. Default is (8, 8).
  • -t, --title: [Optional] Title to add to the image. Default is no title.
  • -p, --preview: [Optional] Show a preview of the input image after some processing.
  • -l, --log: [Optional] Whether to log scale the input image. Default is False.
  • -v, --vmax: [Optional] Maximum value to use for the image. Default is None.
  • -V, --vmin: [Optional] Minimum value to use for the image. Default is None.
  • -c, --contrast: [Optional] The contrast defining the height of the peaks in the waveform. A contrast of 5 will place the maximum peak 5 lines above the flat minimum value. Default is 10.
  • -r, --smooth: [Optional] Radius of the Gaussian smoothing kernel. Default is None.
  • --help: Show a help message and exit.

Example:

unknown-pixels -i path/to/image.jpg -n 50 -t Joy Division -c 10

License

This project is licensed under the GNU General Public License v3.0. 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

unknown_pixels-0.2.0b0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

unknown_pixels-0.2.0b0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file unknown_pixels-0.2.0b0.tar.gz.

File metadata

  • Download URL: unknown_pixels-0.2.0b0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for unknown_pixels-0.2.0b0.tar.gz
Algorithm Hash digest
SHA256 df7ffd0fb5884276b3c4392a8df0eb087cffd38c1d5db29b1d15d6e989b5c31f
MD5 9b652b0cfde526c409eda07a22335472
BLAKE2b-256 38c7d83064f1b85bd1ed601753a28fdaf9f44bf06f8d41388ac80001308f2973

See more details on using hashes here.

Provenance

The following attestation bundles were made for unknown_pixels-0.2.0b0.tar.gz:

Publisher: deploy.yml on WillJRoper/unknown-pixels

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unknown_pixels-0.2.0b0-py3-none-any.whl.

File metadata

File hashes

Hashes for unknown_pixels-0.2.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 62fd49618d64d89741ce88a85f15346eede914cf28bbadf08592c0f662106803
MD5 1e98be12d34b81970da20af10ec287d4
BLAKE2b-256 71ea38f2b750069d1b2b2f5c3475f78b6bb9d3572653004384b5cc1e57ca0da8

See more details on using hashes here.

Provenance

The following attestation bundles were made for unknown_pixels-0.2.0b0-py3-none-any.whl:

Publisher: deploy.yml on WillJRoper/unknown-pixels

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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