Console program to convert a PNG image (e.g. a QR-Code) to text using block graphic symbols.
The primary goal to develop this program has been to support Aqbanking console tools like aqhbci-tool4
and aqbanking-cli
in displaying QR-Code-based photoTANs without the need of invoking a graphical UI.
- Overview
- Dependencies
- Invocation/running
- Internationalization
- Building & Installing
- Supported Platforms
- Getting the Source via Git
pngtotxt is a tiny tool to convert a PNG image to text-based block graphic.
Home Page: https://github.com/pkzw/pngtotxt
pngtotxt depends on
- libiconv (see https://www.gnu.org/software/libiconv/) and
- libpng (see http://www.libpng.org/pub/png/libpng.html).
The following example will convert a QR-Code in file qrcode.png to a text file qrcode.txt:
$ pngtotxt qrcode.png > qrcode.txt
Performing a SEPA bank transfer with aqbanking-cli displaying photoTAN as console output:
$ aqbanking-cli --opticaltan=pngtotxt sepatransfer --iban=...
See program help for more information:
$ pngtotxt --help
Usage: pngtotxt [OPTIONS] [CTY] IFN
This program converts a PNG image to text using block graphic symbols.
Options:
-a, --append Append text to output file
-h, --help Display detailed help information
-o, --output=OFN Output file name (default is standard output)
-v, --version Display version information
CTY is the content-type of the input file (Default is 'image/png').
IFN is the name of the input file (required). Use '-' or 'stdin' to read from standard input.
OFN is the name of the output file.
The program is not yet internationalized and thus available in English language only.
pngtotxt uses CMake to handle the build process.
The follwing example shows how to build the program on a Debian-based system:
# Install prerequisites
sudo apt update
sudo apt install build-essential cmake git libpng-dev
# Clone project from GitHub
mkdir -p ~/git
cd ~/git
git clone https://github.com/pkzw/pngtotxt
# Configure build
mkdir -p ~/build/pngtotxt
cd ~/build/pngtotxt
cmake ~/git/pngtotxt
# Build project
make
# Install
sudo make install
For building on Windows platform see README.W32.md
pngtotxt has been tested to work with the following operating systems:
- GNU/Linux -- x86
- Windows -- x86
pngtotxt can probably be made to work on any platform for which the dependencies can be fulfilled and a C compiler is available, given sufficient expertise and effort.
You can browse the code at https://github.com/pkzw/pngtotxt. Clone URIs are on that page, or if you have a Github account you can fork it there.
Thank you.