Skip to content
W2.Wizard edited this page Feb 9, 2022 · 26 revisions

XPM42

MLX42, like MiniLibX offers built-in support for the XPM format however it implements its own variation of it due to design conflicts regarding the XPM3 variant. XPM overall is a weird format, so much so that it doesn't know if it wants to be written in C or not.

The goal of XPM42 is to introduce a simple to understand format that's not a complete mess.

To convert an XPM3 file to XPM42 download you can download this python script here. Credits and Thanks to TheBriar.

Layout

The file format looks like this:

!XPM42            <- File decleration
16 7 2 1 c        <- Width | Height | Color count | Characters per Pixel | Mode (C: Color or M: Monochrome)
* #FF0000FF       <- Entry always: <Char> <Space> <Hexadecimal> Colors MUST have all four channels (RGBA)
. #00000000
**..*...........  <- Literal pixel data
*.*.*...........
**..*..**.**..**
*.*.*.*.*.*..*.*
**..*..**.*...**
...............*
.............**.

Example

Example

Clone this wiki locally