11/06/2007

FreeImage lib clumsiness

I've been using FreeImage lib for some years now, always with a bad feeling about the architecture and the scalability of its features.

I keep on using it as I didn't find another more convincing image loading library ; but today I had the proof that my feelings were right !

While loading a small 11x11 32bits TGA file, FreeImage reported it as being FIC_RGB and not FIC_RGBA, thus leading my wrapping code to remove the alpha channel... After a quick investigation, I found out that the 'FreeImage_GetColorType' function, when called, actually scans all pixels of RGBA images, and reports FIC_RGB if the alpha channel of every pixel is 255 !

Uh...

2 comments:

lyxite said...

any rationale why it is so?

rotoglup said...

Alas, I don't have a clue... I can't remember having seen any comment in FreeImage source code or documentation...