Skip to main content

Convert images into Unknown Pleasures-style waveform art.

Project description

unknown-pixels

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

Input UP

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.
  • -a, --aspect: [Optional] The aspect ratio of the final image, 1.0 is square, < 1.0 is wide and > 1.0 is tall. Default uses the input image's aspect ratio.
  • -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.
  • -l, --linewidth: [Optional] The width of the lines. Default is 1.0.
  • --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.

Gallery

Wolf Rayet Star

wolf_rayet_up

Stephan's Quintet

stephans_quintet_up

Pillars of Creation

pillars_up

Neptune and Triton

neptune_up

Dark matter Halo from FLAMINGO

flamingo_cluster_uo

Millennium Cosmic Web

cosmic_web_up

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-1.1.0.tar.gz (26.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-1.1.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file unknown_pixels-1.1.0.tar.gz.

File metadata

  • Download URL: unknown_pixels-1.1.0.tar.gz
  • Upload date:
  • Size: 26.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-1.1.0.tar.gz
Algorithm Hash digest
SHA256 643cacff80af5594b271bfc504d60ab7fca105c0d00271f7a07ede37402358b6
MD5 4c2b7b147c4450b672f0bb4fdbfe1f4c
BLAKE2b-256 f1ea1d68fc78fe77666e9a5753cd98129954d8464eac6899f54c373bfb3ac207

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: unknown_pixels-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for unknown_pixels-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51f5c800ab0cd8a30bfa147be8296624cadb4066edcdc14b5bcd86ba58ae2838
MD5 4905ac3ee9771b6ab9cbeed394d02e08
BLAKE2b-256 7955c6883ec4f4d47fb1de093431286d1a213d4145746f9005493c4f198aa887

See more details on using hashes here.

Provenance

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