Skip to main content

Convert an image into a c++ header file containing a bytes array. Useful for electronic projects using a thermal printer or a LCD display.

Project description

Image to cpp

Convert an image into a c++ header file containing a bytes array. Useful for electronic projects using a thermal printer or a LCD display.

Usage

> image-to-cpp --help
usage: main.py [-h] [-r RESIZE] [-s] [-o OUTPUT] [-v] [-d] [-t THRESHOLD] image_path

Convert an image into a byte array c++ code.

positional arguments:
  image_path            Path of image to convert, use `--` to read from stdin.

optional arguments:
  -h, --help            show this help message and exit
  -r RESIZE, --resize RESIZE
                        Resize image to specified width, keeping aspect ratio.
  -s, --show            Only show converted image.
  -o OUTPUT, --output OUTPUT
                        Store to specified file (default: image_name.h), use `--` to output on stdout.
  -v, --verbose         Deactivate information messages.
  -d, --dither          Activate dithering.
  -t THRESHOLD, --threshold THRESHOLD
                        Threshold level when converting to black and white, from 0 to 255 (default: 128).

License

MIT

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

image-to-cpp-0.1.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

image_to_cpp-0.1.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page