04-06-2025, 03:34 AM
Hi TheInstinct,
In setting the format name to "R~G~B~ u8" you are asking for it to store the data in that format.
Set the format name to None and the format of the buffer will be used.
So change to:
data = buffer.get(rect, 1.0, None, Gegl.AbyssPolicy.NONE)
I have just tested this on an indexed image with a 6x6 layer and I am getting the color indexes.
Printing the data, your format name gave:
b'\xec\x00\x00H\xa6\xf00\x84\\\xdc\x1d\xda\xf0\xe8H\xc4DH'
With format name None on the same layer I got:
b'\x00\x04\x03\x01\x05\x02'
and the colour indexes match the palette I used.
In setting the format name to "R~G~B~ u8" you are asking for it to store the data in that format.
Set the format name to None and the format of the buffer will be used.
So change to:
data = buffer.get(rect, 1.0, None, Gegl.AbyssPolicy.NONE)
I have just tested this on an indexed image with a 6x6 layer and I am getting the color indexes.
Printing the data, your format name gave:
b'\xec\x00\x00H\xa6\xf00\x84\\\xdc\x1d\xda\xf0\xe8H\xc4DH'
With format name None on the same layer I got:
b'\x00\x04\x03\x01\x05\x02'
and the colour indexes match the palette I used.