So, I disagree with this, though I can sympathize with the argument up
to a point.
First, I don’t know how to get ImageIO (it’s not CoreImage) to handle
8-bit color palette images. If there is a way, I would love to see a
patch.
Second, I think ImageIO is the right thing to use on Mac and iOS. We
abandoned libpng, libjpeg, libtiff, etc. for many reasons. The binary
sizes were 10x larger, we never kept up with security issues, and the
build systems sucked on Mac.
Third, my interpretation of SDL_image is that it is a simple, opaque
image loader to get things into an SDL_Surface. As such, it is going
to be limited to what is common to most image formats and is not
necessarily required to handle all the weird cases. For example, I
don’t think SDL_image handles the multiple layer/dimension features of
TIFF.
Forth, since we go to so much work to make our SDL Mac frameworks
embeddable anybody can recompile it themselves with libpng and embed
it in their app. They don’t have to worry about dll hell and
conflicting with the official framework.
Fifth, this is 2011, not 1990. SDL 1.3 is embracing OpenGL more
heavily and that rendering model is the future. Color palettes need to
die. OpenGL already dropped their color index features years ago. And
shaders are the future. (But I sympathize with those who are trying to
maintain legacy games.)
Sixth, libpng is actually kind of available on Mac in Leopard and Snow
Leopard if they want to use it directly. However, I think it might be
an “optional” component like the X11 stuff, so we will have to contend
with the Mac App Store issues if we use it.
Seventh, ImageIO is kind of like SDL_image. It already unifies all the
different image loaders into one consistent API. Behind the scenes,
ImageIO is using libpng, libjpeg, libtiff, etc. It is redundant to
re-embed these.
Eighth, ImageIO is the same on Mac and iOS. There is a nice advantage
to having these implementations consistent. (That is one of the items
I still need to push to mainline.)
-EricOn 3/8/11, Kees Bakker <kees.bakker at xs4all.nl> wrote:
Hi,
Since PNG recently was mentioned on the list, I want ask
a question too, about loading PNGs.
When I load a PNG with 8-bit colormap using IMG_load I
get a surface with full 32 bits for each pixel.
I was expecting to get a SDL_surface with a palette
and 1 byte colorindex per pixel.
We’re a bit tight on memory so we need to use the smallest
possible image memory.
What am I missing?
Kees
–
Beginning iPhone Games Development