Celestia icon indicating copy to clipboard operation
Celestia copied to clipboard

Error reading PNG textures with indexed color palette ("Puckman" bug)

Open Askaniy opened this issue 4 years ago • 5 comments

Screenshot from 2018 that explains the bug name. This is Puck, a moon of Uranus: puckman_for_github Today I tested this old texture again because a few more people found this bug, and not only on models.

The texture was tested on 1.6.1 and 1.7.0 (from September 2019), the result is identical. A quarter of the object becomes invisible, everything else becomes translucent. At the places of overlapping the visible part and their eclipsed brightness add up (which is expected from translucency). Also near the observed stratification of the texture by colors, stripes perpendicular to the equator. I suppose that the problem may be with the additional data in PNG that Celestia cannot read correctly.

Almost the same texture with and without a bug: puck_textures.zip

Screenshots: 1.6.1 (+CO) image 1.7.0 image image

Askaniy avatar Mar 02 '20 12:03 Askaniy

I confirm this bug.

SevenSpheres avatar Mar 02 '20 22:03 SevenSpheres

In the provided example:

  • good image is true RGB
  • bad image has indexed palette

ghost avatar Mar 04 '20 15:03 ghost

Thanks, you're right. But I just indexed palette of texture and tested it, and it worked fine. So the problem is something else.

Askaniy avatar Mar 04 '20 16:03 Askaniy

Sudden sequel. It seems that there is also a bug in the specular maps of a certain type, I will study it. image image

Askaniy avatar Jun 03 '20 20:06 Askaniy

I checked Puck's textures and these specular maps for the mode in Pillow (Python library). Сlear result: Celestia doesn't read correctly PNG textures with the indexed color palette, it's the mode P in Pillow.

Askaniy avatar Jun 04 '20 17:06 Askaniy