1
votes

I've been making multiple gameplay changes to a pygame file - there have been no changes in the way that I load images. The only thing I have changed regarding color that I can think of is altering the alpha of fonts (and only fonts). Obviously I don't want to post several hundred lines of code here. But can anyone point to any reason why certain images being loaded suddenly blit as greyscale? The frustrating part is that only certain images load like this, and that this has only started happening recently. I haven't made any changes to the way in which I'm loading files. I've ensured that the .png files are all similar (32 bit depth, etc.), but some load with colors and others don't. I've searched for this issue, but all that comes up are ways to deliberately make images black and white, not inadvertently.

If no one has experienced this before, I don't expect anyone to troubleshoot this for me - I just don't want to have to revert multiple versions of code to discover what single line of code is causing this >.<

I will continue to troubleshoot and post the solution if I find it.

Edit: one thing I have discovered is that 'blit'ing on the screen as opposed to on another image (i.e. background image) seems to retain the color - perhaps certain background images are causing all images 'blit'ed onto it to become grayscale.

Edit 2: Yes, confirmed. Regularly colored images that were 'blit'ed onto .png files with 8 bit depth were converted to grayscale. I used the website https://pixlr.com/editor/ to easily open and save the evil .png files. Now everything is in color again! (I had resized the .png files at fault with another application).

1

1 Answers

1
votes

Regularly colored images that were 'blit'ed onto .png files with 8 bit depth were converted to grayscale. I used the website https://pixlr.com/editor/ to easily open and save the evil .png files. Now everything is in color again! (I had resized the .png files at fault with another application).