Let’s start to write our first program to get the idea. This will demonstrate how to. The CImg Library – C++ Template Image Processing Toolkit. FAQ Summary. General information and availability. What is the CImg Library?.

Author: Shakashura Nikora
Country: Burma
Language: English (Spanish)
Genre: Photos
Published (Last): 9 February 2015
Pages: 365
PDF File Size: 5.29 Mb
ePub File Size: 5.11 Mb
ISBN: 921-5-81413-641-6
Downloads: 63464
Price: Free* [*Free Regsitration Required]
Uploader: Kigalkree

Creation of two instances of images of unsigned char pixels. The first image image is initialized by reading an image file from the disk.

Note that you must also have installed the ImageMagick package in order to be able to read JPG images. The last argument in the constructor defines the default value of the pixel values here 0which means that visu will be initially black.

Definition of three different colors as array of unsigned char. This will be used to draw plots with different colors. Blur the image, with a gaussian blur and a standard variation of 2.

Dochmentation that most of the CImg functions have two versions: Creation of two display windows, one for the input image image, and one for the image visu which will be display intensity profiles. By default, CImg displays handles events mouse,keyboard.


c++ – How to use ‘CImg’ and it’s basic functions – Stack Overflow

On Windows, there is a way to create fullscreen displays. Test if the mouse button has been clicked on the image area. One may distinguish between the 3 different mouse buttons, but in this case it is not necessary.

This line illustrates comg pipeline property of most of the CImg class functions.

The CImg Library Documentation

The first function fill 0 simply sets all pixel values with 0 i. Same thing for the blue channel.

Note how the function which return a reference to visu is pipelined with the function display that just paints the image visu in the corresponding display window. Let’s start to write our first program to get the idea.

documentatikn This will demonstrate how to load and create images, as well as handle image display and mouse events. Assume we want to load a color image lena. Yes, that sounds quite complex for a first code, but don’t worry, it will be very simple using the CImg library!


Well, just look at the code below, it does the task: And here is the detailled explanation of the source, line by line: As you have noticed, the CImg library allows to write very small and intuitive code.

Note also that this source will perfectly work on Unix and Windows systems.

It will show you how CImg-based code can be surprisingly small. Moreover, there is surely one example close to what you want to do. All CImg classes are used in this source, and the code can be easily modified to see what happens.