ReverseBox icon indicating copy to clipboard operation
ReverseBox copied to clipboard

PAL4 pixel indices always encoded in big endian even when image_endianess is set to "little"

Open BloodRaynare opened this issue 8 months ago • 1 comments

I'm currently working on a tools for extracting and converting textures for PS2 Tony Hawk games (THPS4 until THUG2) and your project is immensely a big help so thanks for that. My extraction tools works without a problem but not for the conversion tools. You see, when converting an image to PAL4 format the pixel indices were always encoded in big endian even when I specify image_endianess value to "little" in my code, causing it to look like this (cropped screencap from Big Buck Bunny was used to demonstrate this): Image This is how it should look like: Image In order to achieve the above results, I had to change line 374 in image_encoder.py to this as a workaround: pal_entry_combined: int = pal_entry_number_1 | (pal_entry_number_2 << 4)

BloodRaynare avatar May 02 '25 01:05 BloodRaynare

Image encoder is still a "work in progress" feature, so I'm really suprised that you were able to make it work on your side. :D I've added PAL4 encoding code like 2 weeks ago and I didn't have time to finish it.

But thanks for reporting this. I'll try to add endianess support in the future.

bartlomiejduda avatar May 02 '25 07:05 bartlomiejduda