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
Release history Release notifications | RSS feed
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 details)
Built Distribution
File details
Details for the file image-to-cpp-0.1.0.tar.gz
.
File metadata
- Download URL: image-to-cpp-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.13.0-51-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84eeb8c0d68a3b946c88ec153c17d14b33e31e6ee8cc428913986925986a3bd |
|
MD5 | dfba7c993f04ad6c189017322961756a |
|
BLAKE2b-256 | 145f6ed2c449f2d7745e0bf908c8a9d34deb9ca761f2b28041dbaaac1a05a8cd |
File details
Details for the file image_to_cpp-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: image_to_cpp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.13.0-51-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42f9fd7b6b31516269f3e2fe6051f7fd8fc8f2f5a8b6d641ff0114ed9a111dc2 |
|
MD5 | 7578016212d9d08fcb521c153f368b72 |
|
BLAKE2b-256 | cefa3af5a27208494f7c33190e1c4f7253d45d7b41e7e4e2b0fc92cb13c3cc4c |