Skip to main content

Convert images to black and white (no gray) to use as custom logos on Stripe credit cards.

Project description

logo2cc

logo2cc is a Python library for converting images to black and white (no gray) for use as custom logos on Stripe credit cards.

Processing Pipeline: Applies a slight Gaussian blur, resizes it to fit a maximum dimension of 1000×200 pixels, and centers it on a white canvas.

Installation

  1. Clone this repository or download the files.

  2. In the same directory as setup.py, run:

    pip install logo2cc
    

    or to install in editable mode:

    pip install -e logo2cc
    

Usage

from logo2cc.converter import convert_to_black_and_white

# Convert an image to black & white and save it
convert_to_black_and_white("input_image.png", "output_image.png", threshold=128)

Real-world demo: https://github.com/VerisimilitudeX/logo2cc-demo


How to Install and Use

  1. Install
    In your terminal, change directory (cd) into the location of setup.py, then run:

    pip install logo2cc
    
  2. Import and Call
    In your Python script or REPL:

    from logo2cc.converter import convert_to_black_and_white
    
    convert_to_black_and_white("input.png", "output.png", threshold=128)
    

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

logo2cc-0.1.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

logo2cc-0.1.5-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file logo2cc-0.1.5.tar.gz.

File metadata

  • Download URL: logo2cc-0.1.5.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for logo2cc-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3d8e7d6cb188ee7d5ecd74baf73c715db5ac19856924058a4acd4250be3ebf95
MD5 07af03cafbb0c011aeb674208b3c1f4a
BLAKE2b-256 f3c24410227578cd4ac244ebbb01a7385956031fe4d7d30ad31d3c6b14b634a5

See more details on using hashes here.

File details

Details for the file logo2cc-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: logo2cc-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for logo2cc-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0d45d6a1aeef6e5e3b63c8de756e6001a3b43b1009997801664561d8413faaac
MD5 d47d07f665bf2e81e41fcbf194ffe8d1
BLAKE2b-256 936a087b6e4d48e2db49bc861d0a49f231e1cf0f0da19787697b6605082b20a8

See more details on using hashes here.

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