6 Imago is a simple C library for reading and writing images in many different
9 Currently supported file formats:
10 * PNG (requires libpng).
11 * JPEG (requires libjpeg).
12 * Targa: 24bit or 32bit, raw, or RLE compressed.
13 * Portable PixMap (PPM), and Portable GreyMap (PGM).
14 * Radiance shared exponent HDR (RGBE).
15 * LBM: InterLeaved BitMap (ILBM), and Planar BitMap (PBM).
19 Copyright (C) 2010-2019 John Tsiombikas <nuclear@member.fsf.org>
21 You may freely use, modify and/or redistribute libimago, under the terms of the
22 GNU Lesser General Public License (LGPL) version 3 (or at your option, any
23 later version published by the Free Software Foundation). See `COPYING` and
24 `COPYING.LESSER` for details.
28 Latest release: http://nuclear.mutantstargoat.com/sw/libimago/files/libimago-2.2.tar.gz
30 Grab the source code from github: https://github.com/jtsiomb/libimago
32 Web site: http://nuclear.mutantstargoat.com/sw/libimago
37 Check out the example program under `test/`, and the *heavily*
38 commented `imago2.h` header file, to find out how to use libimago.
40 The simplest way to load image data in RGBA 32bit is:
43 unsigned char *pixels = img_load_pixels("foo.png", &width, &height, IMG_FMT_RGBA32);
44 img_free_pixels(pixels);
46 To load image data in the closest possible format to whatever is natively
47 stored in each particular image file, use:
49 struct img_pixmap img;
51 img_load(&img, "foo.png");
52 /* use img.fmt to determine the actual pixel format we got */
55 There's also an optional interface for loading an image and creating an OpenGL
56 texture out of it in a single call:
58 unsigned int texture = img_gltexture_load("foo.png");
62 To build and install `imago2` on UNIX run:
68 If you wish to avoid the `libpng` or `libjpeg` dependencies, you may disable
69 support for these formats by passing `--disable-png` or `--disable-jpeg` to
72 To build on windows just use msys2/mingw32 and follow the UNIX instructions.
74 To cross-compile for windows with mingw-w64, try the following incantation:
76 ./configure --prefix=/usr/i686-w64-mingw32
77 make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar sys=MINGW32
78 make install sys=MINGW32