2

I'm looking for a Library that allows me to generate an Image via pixel information, in this style(dummyfunction):

/*
 coord_x = X coordinate
 coord_y = Y coordinate
 red     = red part of RGB
 green   = green part of RGB
 blue    = blue part of RGB
*/
setPixel(int coord_x, int coord_y, int red, int green, int blue)

Is there such a Function? I've searched libpng, but it doesn't appear to allow to set pixels manually (might be wrong, though)...

Prefered formats for output would be PNG, GIF would be acceptable, JPG will probably not work (due to compression and lack of transparency as in PNG and GIF).

  • Most of the "libraries" work with images "with pixels". Actually images "without pixels" is something very much exotic nowdays. GDI has `SetPixel/SetPixelV` functions. In most of the libraries you may "lock" your image and get a pointer to its data. There you may directly modify it – valdo Nov 06 '10 at 21:21

4 Answers4

2

a strong and powerful library is Imagick:

Use MagickWand to convert, compose, and edit images from the C language. There is also the low-level MagickCore library for wizard-level developers.

http://www.imagemagick.org/script/api.php?ImageMagick=2m69higs264080492m8ttkndb5#c

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1

If you're on Windows, you could use GDI+.

1

I'd use Boost.GIL.

usta
  • 6,699
  • 3
  • 22
  • 39
0

You could look at ITK (http://www.itk.org). Its primary use is for medical image processing, but it works just as well for processing other images. It's also portable (built using CMake).

Stuart Golodetz
  • 20,238
  • 4
  • 51
  • 80