I want to manually create and save a color-indexed image (palette) as a PNG file, using pygame :
# create the bitmap
res = pygame.Surface((src.width, src.height), depth=8)
# create the palette
res.set_palette([pygame.Color((0, 0, 0, 0)), ...])
pygame.image.save(res, "test.png")
But I get :
error: cannot set palette without pygame.display initialized
on the set_palette line.
Of course, it isn't difficult to initialize some dummy display, but I don't see why it should be the case. Nothing is displayed, and nothing seems display dependant in my code...
Also, it's totally useless to initialize pygame or display when you manipulate 32 bits Surfaces. What's the difference between them ?