Skip to main content

Convert images into Unknown Pleasures-style waveform art.

Project description

unknown-pixels

Input UP UP_Perspective

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.
  • -P, --perspective: [Optional] Add a false perspective effect. Default False.
  • --version: Print the current version.
  • --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.3.1b0.tar.gz (23.8 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.3.1b0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unknown_pixels-0.3.1b0.tar.gz
  • Upload date:
  • Size: 23.8 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.3.1b0.tar.gz
Algorithm Hash digest
SHA256 a2445be8aec782500b734323d7136dfe39394fa395a5fba862a7fae7ef0bf24d
MD5 93f91405cac62d7c54435b1410279335
BLAKE2b-256 e58bff079adeca2469bd7d442e41ff5160efdcebf1d2391cd2cb5a6e50a4fdd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for unknown_pixels-0.3.1b0.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.3.1b0-py3-none-any.whl.

File metadata

File hashes

Hashes for unknown_pixels-0.3.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9a17ce67e25bd2c17563fc114a839efc79c43f472385f23734f3bfa64e49be9
MD5 93b45d5498f9499bdd142612ab84ca01
BLAKE2b-256 d4ef1f14fa3b9104b86c4164f350b11aa0dcc0fff9c6c5abcd975b0a93698402

See more details on using hashes here.

Provenance

The following attestation bundles were made for unknown_pixels-0.3.1b0-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