This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues/pull-requests.
nsxiv/icon
gianmarco 73d521e73a First commit from myself, changed the config and the icons 2022-05-10 22:25:45 +02:00
..
16x16.png First commit from myself, changed the config and the icons 2022-05-10 22:25:45 +02:00
32x32.png First commit from myself, changed the config and the icons 2022-05-10 22:25:45 +02:00
48x48.png First commit from myself, changed the config and the icons 2022-05-10 22:25:45 +02:00
64x64.png First commit from myself, changed the config and the icons 2022-05-10 22:25:45 +02:00
128x128.png First commit from myself, changed the config and the icons 2022-05-10 22:25:45 +02:00
README.md Embed new nsxiv icon (#163) 2021-11-13 17:43:15 +00:00
data.gen.h Embed new nsxiv icon (#163) 2021-11-13 17:43:15 +00:00
data.h Embed new nsxiv icon (#163) 2021-11-13 17:43:15 +00:00
img2data.c Embed new nsxiv icon (#163) 2021-11-13 17:43:15 +00:00

README.md

img2data

img2data is a helper program to convert images to binary data for embedding in software. The generated data is used in nsxiv to set the window icons.

How It Works

Each given image is compressed using run-length encoding and a data array is generated. In these arrays, the four high bits of each byte are the run length minus one and the lowest four bits are the data, which are indices for the color array.

See data.gen.h or the output of img2data for a better understanding.

Dependencies

img2data requires Imlib2 to be installed.

Building

img2data is built using the command:

$ CC -Wall -std=c89 -pedantic -lImlib2 img2data.c -o img2data

where CC is a C compiler such as gcc.

Usage

img2data is used as the following:

$ ./img2data 16x16.png 32x32.png 48x48.png 64x64.png 128x128.png

You may replace or omit any image, but you must have a data.gen.h with at least 1 image for nsxiv to compile.