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.3.0b0.tar.gz (23.5 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.0b0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unknown_pixels-0.3.0b0.tar.gz
  • Upload date:
  • Size: 23.5 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.0b0.tar.gz
Algorithm Hash digest
SHA256 85118a3fa4317623782acd0042d2280f63272da42851872cbfc66f4f74b9fe31
MD5 3769a952df9658d1425584327618d3ff
BLAKE2b-256 5d87821fbeb234ea508d7b74bef7ef593e7ac32b2c069b8c84d216f24bcdf1b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for unknown_pixels-0.3.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 44b5f9f584a1508138083796f48a980d4923c2bbeda8c10738991ae4f7fc3138
MD5 bad7a57cc181f3ff75dfef026822e586
BLAKE2b-256 c43023bc6f01a7237cca255b5d0a9d79a65a2d20ebe0d5023b589558b0a25b27

See more details on using hashes here.

Provenance

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