The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_image: Fix for inaccurate pixel colors (ImageIO backend)
i8degrees


Joined: 22 Nov 2014
Posts: 39
Greetings,

I believe I may have found the cause of the SDL_image "pixel bug" that occurs on Mac OS X and (presumably) iOS when using the ImageIO backend (the default build for OSX, iOS platforms). I need your help to verify a patch I wrote. I would like to try getting this pushed upstream if it turns out that it does resolve the problem. The proposed bug patch can be found in SDL_image's bug database as #2788 (https://bugzilla.libsdl.org/show_bug.cgi?id=2788). I've attached a simple test case I used for testing that you can use yourself in the bug report. General testing with a reply of your results would be greatly appreciated. Testing on iOS hardware hasn't been done and would be nice, too.

The bug can be a show stopper for us anytime we need to rely on the actual pixel colors of a data source (file, stream, whatever), such as the case with color keys, height maps and other general image processing effects.

The reason for the inaccurate pixel data being returned when using Apple's ImageIO backend is because the color is being adjusted (calibrated) with regards for color accuracy, which while may be a nice feature for image viewing, it generally does not bold well for game developers. (If the "feature" were to be of significant interest to people, an additional function could easily be added to the API).

Bug References

1. "Pixel bug in Mac OS X" -- https://forums.libsdl.org/viewtopic.php?p=30317
2. "Perhaps again? Pixel bug in Mac OS X" -- https://forums.libsdl.org/viewtopic.php?t=10013&sid=34e8ef7cf74074039495037c1a077025
SDL_image: Fix for inaccurate pixel colors (ImageIO backend)
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Fixed, thanks!

On Thu, Nov 27, 2014 at 7:12 PM, i8degrees wrote:
Quote:
Greetings,

I believe I may have found the cause of the SDL_image "pixel bug" that occurs on Mac OS X and (presumably) iOS when using the ImageIO backend (the default build for OSX, iOS platforms). I need your help to verify a patch I wrote. I would like to try getting this pushed upstream if it turns out that it does resolve the problem. The proposed bug patch can be found in SDL_image's bug database as #2788 (https://bugzilla.libsdl.org/show_bug.cgi?id=2788). I've attached a simple test case I used for testing that you can use yourself in the bug report. General testing with a reply of your results would be greatly appreciated. Testing on iOS hardware hasn't been done and would be nice, too.

The bug can be a show stopper for us anytime we need to rely on the actual pixel colors of a data source (file, stream, whatever), such as the case with color keys, height maps and other general image processing effects.

The reason for the inaccurate pixel data being returned when using Apple's ImageIO backend is because the color is being adjusted (calibrated) with regards for color accuracy, which while may be a nice feature for image viewing, it generally does not bold well for game developers. (If the "feature" were to be of significant interest to people, an additional function could easily be added to the API).

Bug References

1. "Pixel bug in Mac OS X" -- https://forums.libsdl.org/viewtopic.php?p=30317
2. "Perhaps again? Pixel bug in Mac OS X" -- https://forums.libsdl.org/viewtopic.php?t=10013&sid=34e8ef7cf74074039495037c1a077025



Cheers,
Jeffrey Carpenter


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org