C Image Library [closed]
Asked Answered
C

7

18

Can anyone recommend a decent C image library?

I'm after loaders for bmp, gif, jpg, png and tga.

I want to use this for programming my Sony Playstation Portable, so opensource would be very handy.

After some googleing I've found FreeImage and CImg, but both feel rather heavy, and CImg is C++ not C.

Carline answered 8/9, 2008 at 16:21 Comment(0)
S
21

If you control the images you're loading, the lightest loader I know is Sean Barrett's awesome stb_image.c (direct link to single file source code!).

There are also other very worthwhile libraries on Sean's site such as a tiny TrueType rasterizer and Vorbis decompressor, btw.

If you need OpenGL image loading that uses stb_image, I'll humbly point you to SOILex...

Solutrean answered 2/8, 2010 at 23:3 Comment(0)
T
13

ImageMagick has a C API to connect to its libraries. There's also what they call a "low-level interface" between C and the ImageMagick libraries.

Turco answered 8/9, 2008 at 16:25 Comment(1)
But how portable is it for the PSP.Carline
D
4

I used FreeImage for PSP games in the past, but it was for pre-processing the data rather than in-game.

Detwiler answered 8/9, 2008 at 16:29 Comment(0)
C
3

DevIL is often recommended. Whether or not it does what you want, I don't know.

Cacoepy answered 8/9, 2008 at 16:26 Comment(0)
D
2

I will second Thomas Owens's ImageMagick suggestion. It is mind-boggling just how comprehensive the library is, and how much time it saves you in the end.

Desmonddesmoulins answered 17/9, 2008 at 3:9 Comment(0)
F
1

Here is some code I wrote for handling images. It is in c++ ( not c ) but you should be able to easily extract the BMP and GIF load code. It's licensed LGPL.

I use the libpng and jpeglib for decompressing those formats.

Fungus answered 19/9, 2008 at 0:17 Comment(0)
E
1

For one of my project, I am using CImg Library. It's very useful to start with. Moreover, they also have a decent documentations.

Evocative answered 2/4, 2015 at 17:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.