For XPM2 it is clear how many lines belong to the image – two header lines, the second header line announcing the number of color codes (2 lines in the example above) and rows (height 4 in the example above), e.g.