Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getting colors from pixels

1 view
Skip to first unread message

BlueJ774

unread,
Feb 3, 2009, 12:47:22 AM2/3/09
to
I'm looking for a c++ library I can use to ascertain the RGB value of
a given pixel of an image I've loaded in. I've tried Magick++ without
much luck and libpng looks a little too low-level for what I'm trying
to do. I know there must be a library out there that will do what I'm
looking for. I'm sure I'm not the first person to need such a
facility. I'll be dealing mainly with PNG files and occasionally
JPEG, but lack of JPEG support isn't a deal-breaker. I'd very much
prefer it to exist within the Debian/Ubuntu standard repositories and
I'd like there to be at least a Windows version of the lib if not a
MacOS one as well.

Anyone know of any suitable libs?

Vaclav Haisman

unread,
Feb 3, 2009, 3:14:58 AM2/3/09
to
I don't see what's wrong with libpng or Magick++. They certainly let you get
RGB values for your image's pixels. Maybe if you could describe what you are
doing in more detail, somebody could propose a better tool/library.

--
VH

BlueJ774

unread,
Feb 26, 2009, 1:29:31 AM2/26/09
to
I've tried libgd, which gets the job done, but doesn't play nice with C
++ since it's written from a C paradigm. I've tried cimg, but it has
such crazy overhead. I just want a small portable library or even
just a header that will allow me to open JPEG and PNG and grab RGB
data for each individual pixel. Any ideas?

Michael DOUBEZ

unread,
Feb 26, 2009, 3:35:01 AM2/26/09
to

Have you tried Boost.GIL ? It is a header-only part of Boost that allows
importing png and jpg (provided you have libpng and libjpg installed).
The learning curve is a bit harsh but the examples should get you
started quickly for something so simple.

I have used it to generated images from topographic raw data and it
worked like a charm. A very powerful and well abstracted lib IMHO even
if the semantic is verbose and promote template programming rather than
plain use.

--
Michael

0 new messages