| 1 | img2data |
| 2 | -------- |
| 3 | |
| 4 | img2data is a helper program to convert images to binary data for embedding in |
| 5 | software. The generated data is used in nsxiv to set the window icons. |
| 6 | |
| 7 | |
| 8 | How It Works |
| 9 | ------------ |
| 10 | |
| 11 | Each given image is compressed using run-length encoding and a data array is |
| 12 | generated. In these arrays, the four high bits of each byte are the run length |
| 13 | minus one and the lowest four bits are the data, which are indices for the |
| 14 | color array. |
| 15 | |
| 16 | See `data.gen.h` or the output of img2data for a better understanding. |
| 17 | |
| 18 | |
| 19 | Dependencies |
| 20 | ------------ |
| 21 | |
| 22 | img2data requires Imlib2 to be installed. |
| 23 | |
| 24 | |
| 25 | Building |
| 26 | -------- |
| 27 | |
| 28 | img2data is built using the command: |
| 29 | |
| 30 | $ CC -Wall -std=c89 -pedantic -lImlib2 img2data.c -o img2data |
| 31 | |
| 32 | where `CC` is a C compiler such as `gcc`. |
| 33 | |
| 34 | |
| 35 | Usage |
| 36 | ----- |
| 37 | |
| 38 | img2data is used as the following: |
| 39 | |
| 40 | $ ./img2data 16x16.png 32x32.png 48x48.png 64x64.png 128x128.png |
| 41 | |
| 42 | You may replace or omit any image, but you must have a `data.gen.h` with at |
| 43 | least 1 image for nsxiv to compile. |