C++ libraries to manipulate images - c++

Do you know any open source/free software C++ libraries to manipulate images in these formats:
.jpg .gif .png .bmp ? The more formats it supports, the better. I am implementing a free program in C++ which hides a text file into one or more images, using steganography.
I am working under Unix.

ImageMagick can manipulate about anything and has interfaces for a dozen of languages, including the Magick++ API for C++.

#lurks: I assume that you are looking for LSB shifting? I did some stego work a couple of years ago, and that's how it appeared most apps worked. It appears that ImageMagick (suggested by others) allows you to identify and manipulate the LSBs.

It takes some setting up, but I'm a fan of Adobe's GIL (now part of Boost).

Have you considered GDI?
-- Kevin Fairchild

FreeImage is pretty solid. It has a C interface but is more C++-like in its implementation.

For .png images you could look into Cairo (and CairoMM). There's also Anti-Grain which people consider very fast.

I like vxl
VXL (the Vision-something-Libraries) is a collection of C++ libraries designed for computer vision research and implementation. It was created from TargetJr and the IUE with the aim of making a light, fast and consistent system. VXL is written in ANSI/ISO C++ and is designed to be portable over many platforms.

Related

Saving image as JPG -library?

I'd like to find a JPEG-writing library that can be statically linked (so there are no DLL dependencies). No JPEG-reading ability is required.
Edit: I got LibGD working, but it had one problem described here:
LibGD library is not working: crash when saving image
libjpeg is the most popular library for saving jpegs, but it can be a bit of a pain to use.
Edit, here is a simple example of how to use it. Look for the function juce_writeJPEGImageToStream.
Have you looked at LibGD? I can't seem to find the license, but neither did you specify a requirement.
If you're running your application on Windows then you should use the standard, built-in "GDI+" library that Microsoft provides. Every computer running XP or later has this library.
GDI+ is intended to supersede GDI, which is what you're probably already using whether you know it or not, but it can co-exist with GDI calls provided you flush the buffers when switching between the two. See:
http://www.cpjj.net/Miscellaneous/CreateJPEGFromDC.htm
(Hans Passant - you should have written your comment as an answer).

How can I read/load images in C++?

i am more a java developer and there is a standard way of reading images :
BufferedImage img = null;
try {
img = ImageIO.read(new File("strawberry.png"));
} catch (IOException e) {
}
but what is the c++ way of loading images? I want to load all images in a specific directory into an array or so.
Personally, I prefer the ImageMagick library.
There are many available graphics processing libraries, and there is not a single choice that stands out as clearly superior to the others. My advice is to make a short list of 3 or 4, take a look at the documentation for each, and try to write a simple half-page program with each. Use whichever one you personally find easiest to use.
There is no standard "way" in C++ to load images or files of any other sort. That feature is provided by (usually third-party) libraries.
On Windows, you can use the GDI or DirectX APIs to load images to memory.
You can also use any of many different libraries. Some that come to mind:
SDL-Image
ImageMagick
Qt's QImageReader
wxWidgets
cImg (Which will try to read files if the appropriate filetype-specific library is available.)
Boost.GIL (Which, apparently, has support for JPEG, PNG, and TIFF files.)
There are many, many others to look at, and some may be more appropriate than others depending on what you're trying to do.
For example, if you're only going to be working with JPEG files, then you'll want to use libIJG. Or if you'll only be using PNG, you might find libPNG or cairo to be more appropriate.
The library you will want to use to load images will depend on what you intend to do with it. If you are using a framework such as QT or wxWidgets, it will provide image loading routines.
Another possibility is to use the the SDL Image library, and to work on SDL surfaces, which will allow you to work down to the pixel level if you need.
Take a look at DevIL
Qt has good support for images, and is free and cross-platform.
Check out the qimage class
I would say that the closest you'll get to a standard way of doing this is with the Boost/Adobe Generic Image Library.

Opencv MPEG7 descriptors

I am working on the system that compares images. MPEG-7 standard provides some descriptors which can be used for that e.g: Dominant Color, Color Layout, Edge Histogramm, Color Coherence Vectors.
Do you know where i can get a source code for some of these methods?
Thx!
You can also use the Windows and Linux executables, or easy-to-use API based on OpenCV library, developed for BilVideo-7 video indexing and retrieval system: http://www.cs.bilkent.edu.tr/~bilmdg/bilvideo-7/Software.html.
The ISO distributes reference software as part of the MPEG-7 standard, and among other things it includes feature extraction code for the visual descriptors. The zip file contains another zip file called XMWin.zip, which contains the source. (Despite the "Win" name, it contains instructions for compiling on both windows and unix.)
Hope this helps to other programmers:
Here you can find one implementation on C#
Here another implementation in Java.
For Future readers, there's a CPP library that claims to be easy to use here.
https://github.com/mubastan/mpeg7fex
This has been tested on OpenCV 3, so this is at par the latest.

C++ Library to render ODF documents?

I am unable to find any open source libraries to render ODF documents using C++. I found ODKit suporting Java and AODL for .NET C#.
Does any one have any idea or provide me any pointers.
I found a Qt source to parse ODF. Qt already has built in ODF writer.
KOffice supports ODF and is written in C++. I suspect they may have solved whatever it is you are trying to solve. http://www.koffice.org
It may not be the most elegant solution but OpenOffice itself is capable of rendering and the OOoSDK can be used from C++ as seen here for writer and here for spreadsheet.
There is none. You're better AODL or any of the other libs available (python, perl, java, etc) and doing a binding to it
KOffice can be an idea, but if I just want to display an odt file in a nice Qt QWidget, but I don't want to depends on DBus and a lots of Kde feature.
The Idea is to take a look a Flake and KoText libs as Thomas Zanders says on this Forum.

Decode JPEG to obtain uncompressed data

I want to decode JPEG files and obtain uncompressed decoded output in BMP/RGB format.I am using GNU/Linux, and C/C++.
I had a look at libjpeg, but there seemed not to be any good documentation available.
So my questions are:
Where is documentation on libjpeg?
Can you suggest other C-based jpeg-decompression libraries?
The documentation for libjpeg comes with the source-code. Since you haven't found it yet:
Download the source-code archive and open the file libjpeg.doc. It's a plain ASCII file, not a word document, so better open it in notepad or another ASCII editor.
There are some other .doc files as well. Most of them aren't that interesting though.
Unfortunately I cannot recommend any other library besides libjpeg. I tried a couple of alternatives, but Libjpeg always won. Is pretty easy to work with once you have the basics done. Also it's the most complete and most stable jpeg library out there.
MagickWand is the C API for ImageMagick:
http://imagemagick.org/script/magick-wand.php
I have not used it, but the documentation looks quite extensive.
You should check out Qt's QImage. It has a pretty easy interface that makes this task really easy. Setup is pretty simple for every platform.
If Qt is overkill, you can try Magick++ http://www.imagemagick.org/Magick++/. It supports similar operations and is also well suited for that sort of task. The last time I used it, I struggled a bit with dependencies for it on Windows, but don't recall much trouble on Linux.
For Magick++'s Image class, the function you probably want is getConstPixels.
I have code that you can copy ( or just use as a reference ) for loading a jpeg image using the libjpeg library.
You can browse the code here: http://code.google.com/p/kgui/source/browse/trunk/kguiimage.cpp
Just look for the function LoadJPGImage.
The code is setup to handle c++ binding of my DataHandle class to it for loading the image, that way the image can be a file or data already in memory or whatever.
A slightly out of the box solution is to acquire a copy of the netpbm tools, which transform images from pretty much any format to any other format via one of several very simple intermediate formats. They work well from the shell, and are most often used in pipes to read some arbitrary image, perform an operation on it, and write it out to some other format.
The pbm formats can be as simple as a plain ASCII header followed by the RGB data in ASCII or binary. They are intended to be simple enough to use without required a library to implement.
JPEG is supported in netpbm by read and write filters that are implemented on top of libjpeg.