Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

pixformat

The PiX Format

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

README.md

The PIX (Picture in Hexadecimal Text) Format

In our days, the 24-bit or 32-bit images are accepted as standard image format in general, by operating systems and also are used in Web. But, these format are in binary and also difficult to implementing because of some issues come from past due to compatibility needs.

Transparency (also known as alpha channel) is another issue.

Hopefully, the W3 concercium made a smart decision and add transparency as a standard part for hexadecimal color format in HTML5 and CSS3, like RRGGBBAA, 8-digit hexadecimal format (1).

This apporach has solved big endian and little endian problems. But, most popular image formats still use their internal byte orders.

Altought there are some official or de facto standards, this is still a serious problem for programmers.

Historically, there are a few text-based image formats, like PPM and PGM (P3, P6, etc), but they are 24-bits and they don't support transparency (alpha channel).

(1) Note: No support for 4-digit short hexadecimal format.

The Format

The PiX format is very easy to implement, but, i thinks, it is powerful. It is always 32-bits and by default, tranparency is full opaq, ie., the alpha channel values are FF. No compression. The delimiter is one space character between pixels color values and a newline character between rows/lines.

You can set alpha channel values to graylevel values. Maybe, it is useful for some applications, for example, RRGGBBQQ may be interpretted as Fill-Key values in broadcast world.

Below is a .pix image file format:


pascal
IMG2PIX
Width
Height
RRGGBBAA RRGGBBAA .... RRGGBBAA
RRGGBBAA ...
...
RRGGBBAA ...

That's all.

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2026 ADMGNS