png <-> hex
Project description
hexapixl
hexapixl is a Python command-line utility that allows you to encode and decode PNG images to and from hexadecimal data in a text file. This can be useful for various purposes, such as embedding images in text-based formats or sharing images as text data.
Features
-
Encoding: Convert a PNG image into its hexadecimal representation and save it to a text file.
-
Decoding: Retrieve a PNG image from a text file containing hexadecimal data and save it as an image file.
Prerequisites
Make sure you have the following prerequisites installed in your Python environment:
- Python 3.x
- Required Python libraries (these should be pre-installed with Python):
binasciiargparse
Usage
Encoding an Image to Hexadecimal
To encode a PNG image into hexadecimal format and save it to a text file, use the following command:
python hexapixl.py input_image.png -o output.txt
- input_image.png: The path to the input PNG image.
- -o output.txt: The output text file where the hexadecimal data will be saved.
Decoding Hexadecimal to an Image
To decode a text file containing hexadecimal data and save it as a PNG image, use the following command:
python hexapixl.py -d input.txt -o output_image.png
This command will read the hexadecimal data from "input.txt" and save it as a PNG image named "output_image.png."
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- binascii: Python library for working with binary and ASCII data.
- argparse: Python library for parsing command-line arguments.
Author
werzq
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hexapixl-1.1.1-py3-none-any.whl.
File metadata
- Download URL: hexapixl-1.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
785f776fa2f989ec8cd9c211f184fbd8765ff39a2dd0fc9fdf2b79282ac94b0e
|
|
| MD5 |
312025657172b034633a2efb0e766f98
|
|
| BLAKE2b-256 |
cfa76c73ff434f69d0601b8fa33d8774614723e891744fced65aab652495a08e
|