new SDL_image on MacOSX loads PNG different than earlier |
albert
|
This is the png:
https://github.com/albertz/openlierox/raw/0.59/share/gamedir/data/gfx/font.png The code for checking is basically:
And this is the output:
Earlier, the value FF1514F4 has been FF0000FF. Gimp also shows FF0000FF at this place. Seashore and other applications show FF1514F4. When I load the image via libgd, I also get FF0000FF. This might be an issue in ImageIO. Or maybe some color profile thingie. Any idea? |
|||||||||||||||
|
new SDL_image on MacOSX loads PNG different than earlier |
Eric Wing
Guest
|
This has been discussed before on the list. Check the archives,
specifically for a thread called "Pixel bug in Mac OS X". I posted some code I wanted people to test at the end of the thread, but nobody ever got back to me with results. -Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ On 12/26/11, albert wrote:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
albert
|
Test case: https://gist.github.com/1551241
It should output:
Output with bad SDL_image:
And I searched a bit around and I found a fix in the Allegro code (http://codesearch.google.com/#w3aXj_apqFs/allegro/tags/5.0.0/addons/image/macosx.m&ct=rc&cd=3&q=CGColorSpaceCreateCalibratedRGB). So I wrote a patch for SDL_image: https://gist.github.com/1551404 @Sam: Can you apply this? |
|||||||||||||||
|
new SDL_image on MacOSX loads PNG different than earlier |
Vittorio Giovara
Guest
|
IIRC, this is because using imageio requires to have the alpha channel premultiplied.
The fix proposed did this, but negleted byte precision information: see http://bugzilla.libsdl.org/show_bug.cgi?id=868 If you ever try out Eric's changes do let us know Vittorio On Mon, Dec 26, 2011 at 12:37 PM, albert wrote:
|
|||||||||||||
|
Re: new SDL_image on MacOSX loads PNG different than earlier |
albert
|
This is not premultiplied alpha as you can see from the output. The alpha channel is always 0xff. This is because the color space/profile is device dependent. That is always with CGColorSpaceCreateDeviceRGB. See here: http://developer.apple.com/library/mac/documentation/graphicsimaging/reference/CGColorSpace/Reference/reference.html#//apple_ref/c/func/CGColorSpaceCreateDeviceRGB And my patch makes the color space device independent so that it doesn't change it. |
|||||||||||||
|
new SDL_image on MacOSX loads PNG different than earlier |
Vittorio Giovara
Guest
|
Ops, my mistake, hadn't realized alpha was always 0xff
Which patch are you talking about thought? Vittorio On Wed, Jan 4, 2012 at 12:51 AM, albert wrote:
|
|||||||||||||
|
Re: new SDL_image on MacOSX loads PNG different than earlier |
albert
|
This one: https://gist.github.com/1551404 From here (with some more details): http://forums.libsdl.org/viewtopic.php?p=31258#31258 |
|||||||||||||
|
new SDL_image on MacOSX loads PNG different than earlier |
Sam Lantinga
|
Fixed, thanks! http://hg.libsdl.org/SDL_image/rev/5953114c0d27
I appreciate you finding that, people have been asking about that for a while. On Tue, Jan 3, 2012 at 7:50 PM, albert wrote:
|
|||||||||||||
|