├── .github └── workflows │ └── Test_Build.yml ├── .travis.yml ├── CImg.h ├── Licence_CeCILL-C_V1-en.txt ├── Licence_CeCILL_V2-en.txt ├── README.md ├── README.txt ├── examples ├── CImg_demo.cpp ├── CMakeLists.txt ├── Makefile ├── captcha.cpp ├── curve_editor2d.cpp ├── dtmri_view3d.cpp ├── edge_explorer2d.cpp ├── fade_images.cpp ├── gaussian_fit1d.cpp ├── generate_loop_macros.cpp ├── hough_transform2d.cpp ├── image2ascii.cpp ├── image_registration2d.cpp ├── image_surface3d.cpp ├── img │ ├── CImg_demo.h │ ├── logo.bmp │ ├── milla.bmp │ ├── odykill.h │ ├── parrot.ppm │ ├── parrot_mask.pgm │ ├── sh0r.pgm │ ├── sh1r.pgm │ └── tetris.h ├── jawbreaker.cpp ├── mcf_levelsets2d.cpp ├── mcf_levelsets3d.cpp ├── odykill.cpp ├── pde_TschumperleDeriche2d.cpp ├── pde_heatflow2d.cpp ├── plotter1d.cpp ├── radon_transform2d.cpp ├── scene3d.cpp ├── spherical_function3d.cpp ├── tetris.cpp ├── tron.cpp ├── tutorial.cpp ├── use_RGBclass.cpp ├── use_chlpca.cpp ├── use_cimgIPL.cpp ├── use_cimgmatlab.cpp ├── use_cimgmatlab.m ├── use_draw_gradient.cpp ├── use_jpeg_buffer.cpp ├── use_nlmeans.cpp ├── use_skeleton.cpp ├── use_tiff_stream.cpp ├── use_tinymatwriter.cpp └── wavelet_atrous.cpp ├── html ├── CImg.doxygen ├── CImg_documentation.h ├── CImg_flyer.svg ├── CImg_reference_chinese.pdf ├── download.html ├── favicon.ico ├── favicon.png ├── footer.html ├── footer_doxygen.html ├── header.html ├── header_doxygen.html ├── highslide.js ├── highslide │ ├── graphics │ │ ├── close.png │ │ ├── closeX.png │ │ ├── controlbar-black-border.gif │ │ ├── controlbar-text-buttons.png │ │ ├── controlbar-white-small.gif │ │ ├── controlbar-white.gif │ │ ├── controlbar2.gif │ │ ├── controlbar3.gif │ │ ├── controlbar4-hover.gif │ │ ├── controlbar4.gif │ │ ├── fullexpand.gif │ │ ├── geckodimmer.png │ │ ├── icon.gif │ │ ├── loader.gif │ │ ├── loader.white.gif │ │ ├── outlines │ │ │ ├── Outlines.psd │ │ │ ├── beveled.png │ │ │ ├── drop-shadow.png │ │ │ ├── glossy-dark.png │ │ │ ├── outer-glow.png │ │ │ ├── rounded-black.png │ │ │ └── rounded-white.png │ │ ├── resize.gif │ │ ├── scrollarrows.png │ │ ├── zoomin.cur │ │ └── zoomout.cur │ ├── highslide-full.js │ ├── highslide-full.min.js │ ├── highslide-full.packed.js │ ├── highslide-ie6.css │ ├── highslide-with-gallery.js │ ├── highslide-with-gallery.min.js │ ├── highslide-with-gallery.packed.js │ ├── highslide-with-html.js │ ├── highslide-with-html.min.js │ ├── highslide-with-html.packed.js │ ├── highslide.css │ ├── highslide.js │ ├── highslide.min.js │ └── highslide.packed.js ├── img │ ├── book_cimg.jpg │ ├── book_cimg_en.jpg │ ├── item_clickvideo.jpg │ ├── item_clickvideo2.jpg │ ├── item_description.jpg │ ├── item_extensibility.jpg │ ├── item_file.jpg │ ├── item_freedom.jpg │ ├── item_genericity.jpg │ ├── item_portability.jpg │ ├── item_simplicity.jpg │ ├── item_sources.jpg │ ├── item_sources2.jpg │ ├── item_standard_package.jpg │ ├── item_standard_package2.jpg │ ├── item_usefulness.jpg │ ├── logoCImg0.png │ ├── logoCNRS.gif │ ├── logoGREYC.gif │ ├── logoIMAGE.gif │ ├── logoINRIA.gif │ ├── logoODYSSEE.jpg │ ├── logo_header.jpg │ ├── logo_header.xcf │ ├── logo_header_old.jpg │ ├── menu_download.png │ ├── menu_faq.png │ ├── menu_home.png │ ├── menu_issue.png │ ├── menu_links.png │ ├── menu_reference.png │ ├── menu_screenshots.png │ ├── menu_tutorial.png │ ├── postcard1.jpg │ ├── postcard10.jpg │ ├── postcard11.jpg │ ├── postcard12.jpg │ ├── postcard13.jpg │ ├── postcard14.jpg │ ├── postcard15.jpg │ ├── postcard16.jpg │ ├── postcard17.jpg │ ├── postcard18.jpg │ ├── postcard19.jpg │ ├── postcard2.jpg │ ├── postcard20.jpg │ ├── postcard21.jpg │ ├── postcard22.jpg │ ├── postcard23.jpg │ ├── postcard24.jpg │ ├── postcard25.jpg │ ├── postcard26.jpg │ ├── postcard27.jpg │ ├── postcard28.jpg │ ├── postcard29.jpg │ ├── postcard3.jpg │ ├── postcard30.jpg │ ├── postcard31.jpg │ ├── postcard32.jpg │ ├── postcard33.jpg │ ├── postcard34.jpg │ ├── postcard35.jpg │ ├── postcard36.jpg │ ├── postcard37.jpg │ ├── postcard38.jpg │ ├── postcard39.jpg │ ├── postcard4.jpg │ ├── postcard40.jpg │ ├── postcard41.jpg │ ├── postcard42.jpg │ ├── postcard43.jpg │ ├── postcard44.jpg │ ├── postcard45.jpg │ ├── postcard46.jpg │ ├── postcard47.jpg │ ├── postcard48.jpg │ ├── postcard49.jpg │ ├── postcard5.jpg │ ├── postcard50.jpg │ ├── postcard51.jpg │ ├── postcard52.jpg │ ├── postcard53.jpg │ ├── postcard54.jpg │ ├── postcard55.jpg │ ├── postcard56.jpg │ ├── postcard57.jpg │ ├── postcard58.jpg │ ├── postcard59.jpg │ ├── postcard6.jpg │ ├── postcard60.jpg │ ├── postcard61.jpg │ ├── postcard62.jpg │ ├── postcard63.jpg │ ├── postcard64.jpg │ ├── postcard65.jpg │ ├── postcard66.jpg │ ├── postcard67.jpg │ ├── postcard68.jpg │ ├── postcard69.jpg │ ├── postcard7.jpg │ ├── postcard70.jpg │ ├── postcard71.jpg │ ├── postcard72.jpg │ ├── postcard73.jpg │ ├── postcard74.jpg │ ├── postcard75.jpg │ ├── postcard76.jpg │ ├── postcard77.jpg │ ├── postcard78.jpg │ ├── postcard79.jpg │ ├── postcard8.jpg │ ├── postcard80.jpg │ ├── postcard9.jpg │ ├── reference │ │ ├── ref_box3d.jpg │ │ ├── ref_colormap_cool.jpg │ │ ├── ref_colormap_cube.jpg │ │ ├── ref_colormap_default.jpg │ │ ├── ref_colormap_flag.jpg │ │ ├── ref_colormap_hot.jpg │ │ ├── ref_colormap_hsv.jpg │ │ ├── ref_colormap_jet.jpg │ │ ├── ref_colormap_lines.jpg │ │ ├── ref_cone3d.jpg │ │ ├── ref_constructor1.jpg │ │ ├── ref_constructor2.jpg │ │ ├── ref_contrast_LUT256.jpg │ │ ├── ref_cut.jpg │ │ ├── ref_cylinder3d.jpg │ │ ├── ref_default_LUT256.jpg │ │ ├── ref_elevation3d.jpg │ │ ├── ref_ellipsoid3d.jpg │ │ ├── ref_equalize.jpg │ │ ├── ref_histogram.jpg │ │ ├── ref_image.jpg │ │ ├── ref_index.jpg │ │ ├── ref_isoline3d.jpg │ │ ├── ref_isosurface3d.jpg │ │ ├── ref_label_regions.jpg │ │ ├── ref_map.jpg │ │ ├── ref_noise.jpg │ │ ├── ref_norm.jpg │ │ ├── ref_normalize.jpg │ │ ├── ref_normalize2.jpg │ │ ├── ref_operator_comma.jpg │ │ ├── ref_operator_eq.jpg │ │ ├── ref_operator_less.jpg │ │ ├── ref_operator_minus.jpg │ │ ├── ref_operator_plus.jpg │ │ ├── ref_operator_plus1.jpg │ │ ├── ref_plane3d.jpg │ │ ├── ref_quantize.jpg │ │ ├── ref_rainbow_LUT256.jpg │ │ ├── ref_sphere3d.jpg │ │ ├── ref_sqr.jpg │ │ ├── ref_sqrt.jpg │ │ ├── ref_threshold.jpg │ │ └── ref_torus3d.jpg │ ├── section_bottom.png │ ├── section_bottom_mirrored.png │ ├── section_middle.png │ ├── section_top.png │ ├── ss_blobs.jpg │ ├── ss_bubble.jpg │ ├── ss_bump.jpg │ ├── ss_demomenu.jpg │ ├── ss_dtmri.jpg │ ├── ss_fourier.jpg │ ├── ss_hough.jpg │ ├── ss_imgfade.jpg │ ├── ss_jawbreaker.jpg │ ├── ss_landscape.jpg │ ├── ss_mandelbrot.jpg │ ├── ss_metaballs.jpg │ ├── ss_mini_000000.jpg │ ├── ss_mini_000001.jpg │ ├── ss_mini_000002.jpg │ ├── ss_mini_000003.jpg │ ├── ss_mini_000004.jpg │ ├── ss_mini_000005.jpg │ ├── ss_mini_000006.jpg │ ├── ss_mini_000007.jpg │ ├── ss_mini_000008.jpg │ ├── ss_mini_000009.jpg │ ├── ss_mini_000010.jpg │ ├── ss_mini_000011.jpg │ ├── ss_mini_000012.jpg │ ├── ss_mini_000013.jpg │ ├── ss_mini_000014.jpg │ ├── ss_mini_000015.jpg │ ├── ss_mini_000016.jpg │ ├── ss_mini_000017.jpg │ ├── ss_mini_000018.jpg │ ├── ss_mini_000019.jpg │ ├── ss_mini_000020.jpg │ ├── ss_mini_000021.jpg │ ├── ss_mini_000022.jpg │ ├── ss_mini_000023.jpg │ ├── ss_mini_000024.jpg │ ├── ss_mini_000025.jpg │ ├── ss_mini_000026.jpg │ ├── ss_mini_000027.jpg │ ├── ss_odykill.jpg │ ├── ss_optflow.jpg │ ├── ss_paint.jpg │ ├── ss_plasma.jpg │ ├── ss_puzzle.jpg │ ├── ss_reflection.jpg │ ├── ss_render3d.jpg │ ├── ss_restoration.jpg │ ├── ss_rotozoom.jpg │ ├── ss_shadebobs.jpg │ ├── ss_surface.jpg │ ├── ss_tetris.jpg │ ├── ss_triangle.jpg │ ├── ss_volume3d.jpg │ ├── ss_waves.jpg │ └── tutorial.jpg ├── index.html ├── jquery-3.5.1.min.js ├── links.html ├── screenshots.html └── style.css ├── plugins ├── add_fileformat.h ├── bayer.h ├── chlpca.h ├── cvMat.h ├── draw_gradient.h ├── inpaint.h ├── ipl.h ├── ipl_alt.h ├── jpeg_buffer.h ├── loop_macros.h ├── matlab.h ├── nlmeans.h ├── skeleton.h ├── tiff_stream.h ├── tinymatwriter.h ├── vrml.h └── vtk.h └── resources ├── CImg.pc ├── cimg_buildpackage ├── cimg_ftp ├── compile_win_icl.bat ├── compile_win_visualcpp.bat ├── debian ├── changelog ├── cimg-dev.dirs ├── cimg-dev.install ├── cimg-dev.links ├── compat ├── control ├── copyright ├── docs └── rules ├── project_win_visualcpp ├── project_win_visualcpp.sln ├── project_win_visualcpp.suo └── project_win_visualcpp.vcproj └── pycimg.py /.github/workflows/Test_Build.yml: -------------------------------------------------------------------------------- 1 | name: Build then test 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | build-on-ubuntu: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | - name: Install dependencies 15 | run: | 16 | sudo apt-get install -y gcc g++ clang libpng-dev libjpeg-dev libmagick++-dev 17 | sudo apt-get install -y libgraphicsmagick++-dev libfftw3-dev zlib1g-dev libheif-dev 18 | - name: build 19 | run: | 20 | pushd examples 21 | make clean 22 | make mlinux 23 | popd 24 | - name: test 25 | run: | 26 | pushd examples 27 | ./image2ascii 28 | ./generate_loop_macros 29 | popd 30 | 31 | 32 | build-on-macos: 33 | runs-on: macos-latest 34 | steps: 35 | - uses: actions/checkout@v3 36 | - name: Install dependencies 37 | run: | 38 | brew install libheif libpng fftw libjpeg gcc zlib imagemagick automake openexr llvm 39 | - name: build 40 | run: | 41 | pushd examples 42 | make clean 43 | make mmacos 44 | popd 45 | - name: test 46 | run: | 47 | pushd examples 48 | ./image2ascii 49 | ./generate_loop_macros 50 | popd 51 | 52 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: 3 | - gcc 4 | script: 5 | - cd examples 6 | - make travis 7 | addons: 8 | apt: 9 | sources: 10 | - ubuntu-toolchain-r-test 11 | packages: 12 | - gcc-4.8 13 | - g++-4.8 14 | - clang 15 | - libpng12-dev 16 | - libjpeg-dev 17 | - libmagick++-dev 18 | - libgraphicsmagick++1-dev 19 | - libfftw3-dev -------------------------------------------------------------------------------- /Licence_CeCILL-C_V1-en.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/Licence_CeCILL-C_V1-en.txt -------------------------------------------------------------------------------- /Licence_CeCILL_V2-en.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/Licence_CeCILL_V2-en.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Logo](http://cimg.eu/img/logo_header.jpg) 2 | ##### http://cimg.eu 3 | 4 | ------------------ 5 | ![Build](https://github.com/GreycLab/CImg/workflows/Build%20then%20test/badge.svg) 6 | ------------------ 7 | The **CImg Library** is a **small** and **open-source** **C++ library** for **image processing**, designed with these properties in mind: 8 | 9 | ![Usefulness](http://cimg.eu/img/item_usefulness.jpg) **CImg** defines *classes* and *methods* to manage images in your own C++ code. You can use **CImg** to load/save various file formats, access pixel values, display/transform/filter images, draw primitives (text, faces, curves, 3d objects, ...), compute statistics, manage user interactions on images, and so on... 10 | 11 | ![Genericity](http://cimg.eu/img/item_genericity.jpg) **CImg** defines a single image class able to represent datasets having up to *4-dimensions* (from 1d scalar signals to 3d hyperspectral volumetric images), with *template pixel types* (`bool,char,int,float,...`). It also handles image *collections* and *sequences*. 12 | 13 | ![Portability](http://cimg.eu/img/item_portability.jpg) **CImg** is *self-contained*, *thread-safe* and *highly portable*. It fully works on *different operating systems* (`Unix,Windows,MacOS X,*BSD,...`) and is compatible with *various C++ compilers* (`Visual C++,g++,clang++,icc,...`). 14 | 15 | ![Simplicity](http://cimg.eu/img/item_simplicity.jpg) **CImg** is *lightweight*. It is made of a single header file [`CImg.h`](https://github.com/GreycLab/CImg/raw/master/CImg.h) that must be included in your C++ source. It defines only *four* different classes, encapsulated in the namespace `cimg_library`. It can be compiled using a minimal set of standard C++ and system libraries only. *No need for exotic or complex dependencies*. 16 | 17 | ![Extensibility](http://cimg.eu/img/item_extensibility.jpg) Although not mandatory, **CImg** can use functionalities of external tools/libraries such as [Board](http://libboard.sourceforge.net/), [FFMPEG](http://ffmpeg.mplayerhq.hu/), [FFTW3](http://www.fftw.org/), [GraphicsMagick](http://www.graphicsmagick.org/), [ImageMagick](http://www.imagemagick.org/), [Lapack](http://www.netlib.org/lapack/), [libcurl](http://curl.haxx.se/libcurl/), [libjpeg](http://www.ijg.org/), [libpng](http://www.libpng.org/pub/png/libpng.html), [libtiff](http://www.libtiff.org/), [Magick++](http://www.imagemagick.org/Magick++/), [OpenEXR](http://www.openexr.com/), [OpenCV](http://http://opencv.willowgarage.com/wiki/), [OpenMP](http://www.openmp.org/) or [XMedCon](http://xmedcon.sourceforge.net/). Moreover, a simple *plug-in* mechanism allows any user to directly enhance the library capabilities according to their needs. 18 | 19 | ![Freedom](http://cimg.eu/img/item_freedom.jpg) **CImg** is a *free, open-source library* distributed under the [*CeCILL-C*](http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.txt) (close to the GNU LGPL) or [CeCILL](http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt) (compatible with the GNU GPL) licenses. It can be used in commercial applications. 20 | 21 | ------------------ 22 | 23 | > **CImg** stands for **Cool Image** : It is _easy to use_, _efficient_ and is intended to be a very pleasant toolbox to design image processing algorithms in C++. Due to its generic conception, it can cover a wide range of image processing applications. 24 | 25 | ------------------ 26 | -------------------------------------------------------------------------------- /examples/fade_images.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : fade_images.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Compute a linear fading between two images. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : David Tschumperlé 11 | # ( http://tschumperle.users.greyc.fr/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | #include "CImg.h" 45 | #ifndef cimg_imagepath 46 | #define cimg_imagepath "img/" 47 | #endif 48 | #undef min 49 | #undef max 50 | 51 | // Main procedure 52 | //--------------- 53 | int main(int argc,char **argv) { 54 | 55 | // Read and check command line parameters. 56 | cimg_usage("Compute a linear fading between two 2D images"); 57 | const char *file_i1 = cimg_option("-i1",cimg_imagepath "sh0r.pgm","Input Image 1"); 58 | const char *file_i2 = cimg_option("-i2",cimg_imagepath "milla.bmp","Input Image 2"); 59 | const char *file_o = cimg_option("-o",(char*)0,"Output Image"); 60 | const bool visu = cimg_option("-visu",true,"Visualization mode"); 61 | const double pmin = cimg_option("-min",40.0,"Begin of the fade (in %)")/100.0; 62 | const double pmax = cimg_option("-max",60.0,"End of the fade (in %)")/100.0; 63 | const double angle = cimg_option("-angle",0.0,"Fade angle")*cil::cimg::PI/180; 64 | 65 | // Init images. 66 | cil::CImg img1(file_i1), img2(file_i2); 67 | if (!img2.is_sameXYZC(img1)) { 68 | int 69 | dx = std::max(img1.width(),img2.width()), 70 | dy = std::max(img1.height(),img2.height()), 71 | dz = std::max(img1.depth(),img2.depth()), 72 | dv = std::max(img1.spectrum(),img2.spectrum()); 73 | img1.resize(dx,dy,dz,dv,3); 74 | img2.resize(dx,dy,dz,dv,3); 75 | } 76 | cil::CImg dest(img1); 77 | 78 | // Compute the faded image. 79 | const double ca = std::cos(angle), sa = std::sin(angle); 80 | double alpha; 81 | cimg_forXYZC(dest,x,y,z,k) { 82 | const double X = ((double)x/img1.width() - 0.5)*ca + ((double)y/img1.height() - 0.5)*sa; 83 | if (X + 0.5pmax) alpha = 1; else 85 | alpha = (X + 0.5 - pmin)/(pmax - pmin); 86 | } 87 | dest(x,y,z,k) = (unsigned char)((1 - alpha)*img1(x,y,z,k) + alpha*img2(x,y,z,k)); 88 | } 89 | 90 | // Save and exit 91 | if (file_o) dest.save(file_o); 92 | if (visu) dest.display("Image fading"); 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /examples/image2ascii.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : image2ascii.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : A basic image to ASCII-art converter. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : David Tschumperlé 11 | # ( http://tschumperle.users.greyc.fr/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | // Tell CImg not to use display capabilities. 45 | #undef cimg_display 46 | #define cimg_display 0 47 | #include "CImg.h" 48 | using namespace cimg_library; 49 | 50 | /*--------------------------- 51 | 52 | Main procedure 53 | 54 | --------------------------*/ 55 | int main(int argc,char **argv) { 56 | cimg_usage("A simple image to ASCII-art converter.\n\nUsage : image2ascii [options] image"); 57 | 58 | // Read command line parameters 59 | const char *const file_i = cimg_option("-i",(char*)0,"Input image"); 60 | const char *const geom = cimg_option("-g","79x40","Output size"); 61 | const int alphabet = cimg_option("-a",0,"Alphabet type (0=full, 1=numbers, 2=letters, 3=signs, 4=minimal"); 62 | const bool invert = cimg_option("-invert",false,"Invert image intensities"); 63 | const float contour = (float)cimg_option("-contour",0.0f,"Use image contours higher than specified threshold"); 64 | const float blur = (float)cimg_option("-blur",0.8f,"Image pre-blur"); 65 | const float sigma = (float)cimg_option("-sigma",10.0f,"Font pre-blur"); 66 | 67 | int w = 79, h = 40; 68 | std::sscanf(geom,"%d%*c%d",&w,&h); 69 | if (cimg_option("-h",false,0)) std::exit(0); 70 | 71 | // Init fonts 72 | CImgList<> font_full = CImgList<>::font(13,false); 73 | font_full.remove(0,255); 74 | const int fw = font_full[(int)'A'].width(), fh = font_full[(int)'A'].height(); 75 | CImgList<> font, font_blur; 76 | CImgList font_code; 77 | 78 | switch (alphabet) { 79 | case 1: { 80 | font_code.insert(CImg<>::vector(' ')); 81 | for (unsigned char l='0'; l<='9'; l++) font_code.insert(CImg<>::vector(l)); 82 | } break; 83 | case 2: { 84 | font_code.insert(CImg<>::vector(' ')); 85 | for (unsigned char l='A'; l<='Z'; l++) font_code.insert(CImg<>::vector(l)); 86 | } break; 87 | case 3: { 88 | font_code.insert(CImg<>::vector(' ')); 89 | font_code.insert(CImg<>::vector('-')); 90 | font_code.insert(CImg<>::vector('_')); 91 | font_code.insert(CImg<>::vector('|')); 92 | font_code.insert(CImg<>::vector('/')); 93 | font_code.insert(CImg<>::vector('\\')); 94 | font_code.insert(CImg<>::vector('+')); 95 | font_code.insert(CImg<>::vector('.')); 96 | font_code.insert(CImg<>::vector('*')); 97 | font_code.insert(CImg<>::vector('=')); 98 | font_code.insert(CImg<>::vector(']')); 99 | font_code.insert(CImg<>::vector('[')); 100 | font_code.insert(CImg<>::vector('(')); 101 | font_code.insert(CImg<>::vector(')')); 102 | font_code.insert(CImg<>::vector('{')); 103 | font_code.insert(CImg<>::vector('}')); 104 | font_code.insert(CImg<>::vector('"')); 105 | font_code.insert(CImg<>::vector('!')); 106 | font_code.insert(CImg<>::vector('$')); 107 | } break; 108 | case 4: { 109 | font_code.insert(CImg<>::vector(' ')); 110 | font_code.insert(CImg<>::vector('.')); 111 | font_code.insert(CImg<>::vector('/')); 112 | font_code.insert(CImg<>::vector('\\')); 113 | font_code.insert(CImg<>::vector('_')); 114 | font_code.insert(CImg<>::vector('_')); 115 | font_code.insert(CImg<>::vector('|')); 116 | } break; 117 | default: { for (unsigned char l=' '; l<='~'; l++) font_code.insert(CImg<>::vector(l)); } break; 118 | } 119 | cimglist_for(font_code,l) { 120 | font.insert(font_full(font_code[l](0))); 121 | font_blur.insert(font[l].get_resize(fw,fh,1,1).blur(sigma).normalize(0,255)); 122 | } 123 | 124 | // Init images 125 | CImg<> img; 126 | if (!file_i) { float white[3] = { 255,255,255 }; img.assign().draw_text(0,0," CImg\nRocks !",white); } 127 | else img.assign(file_i); 128 | img.norm().resize(fw*w,fh*h); 129 | if (blur) img.blur(blur); 130 | if (contour>0) { 131 | CImgList<> grad = img.get_gradient("xy",4); 132 | img = (grad[0].pow(2) + grad[1].pow(2)).sqrt().normalize(0,100).threshold(contour); 133 | } 134 | img.normalize(0,255); 135 | if (invert) img = 255.0f - img; 136 | CImg dest(w,h,1,1,0); 137 | 138 | // Render ASCII-art image, using a simple correlation method. 139 | CImg<> neigh; 140 | cimg_forY(dest,y) { cimg_forX(dest,x) { 141 | neigh = img.get_crop(x*fw,y*fh,(x + 1)*fw,(y + 1)*fh); 142 | float scoremin = 2e28f; 143 | unsigned int best = 0; 144 | cimglist_for(font_code,l) { 145 | const CImg<>& letter = font_blur[l]; 146 | const float score = (float)((letter - neigh).pow(2).sum()); 147 | if (score 65 | img = CImg<>(file_i).blur(sigma).resize(-100,-100,1,3), 66 | norm = img.get_norm().normalize(0,255); 67 | 68 | // Compute surface with triangles. 69 | std::fprintf(stderr,"\n- Create image surface"); std::fflush(stderr); 70 | CImgList primitives; 71 | CImgList colors; 72 | const CImg<> points = img.get_elevation3d(primitives,colors,norm*-ratioz); 73 | 74 | // Compute image isophotes. 75 | std::fprintf(stderr,"\n- Compute image isophotes"); std::fflush(stderr); 76 | CImgList isoprimitives; 77 | CImgList isocolors; 78 | CImg<> isopoints; 79 | for (unsigned int i = 0; i<255; i+=di) { 80 | CImgList<> prims; 81 | const CImg<> pts = norm.get_isoline3d(prims,(float)i); 82 | isopoints.append_object3d(isoprimitives,pts,prims); 83 | } 84 | cimglist_for(isoprimitives,l) { 85 | const unsigned int i0 = isoprimitives(l,0); 86 | const float x0 = isopoints(i0,0), y0 = isopoints(i0,1); 87 | const unsigned char 88 | r = (unsigned char)img.linear_atXY(x0,y0,0), 89 | g = (unsigned char)img.linear_atXY(x0,y0,1), 90 | b = (unsigned char)img.linear_atXY(x0,y0,2); 91 | isocolors.insert(CImg::vector(r,g,b)); 92 | } 93 | cimg_forX(isopoints,ll) isopoints(ll,2) = -ratioz*norm.linear_atXY(isopoints(ll,0),isopoints(ll,1)); 94 | 95 | // Save object if necessary 96 | if (file_o) { 97 | std::fprintf(stderr,"\n- Save 3d object as '%s'",cimg::basename(file_o)); std::fflush(stderr); 98 | points.save_off(primitives,colors,file_o); 99 | } 100 | 101 | // Enter event loop 102 | std::fprintf(stderr, 103 | "\n- Enter interactive loop.\n\n" 104 | "Reminder : \n" 105 | " + Use mouse to rotate and zoom object\n" 106 | " + key 'F' : Toggle fullscreen\n" 107 | " + key 'Q' or 'ESC' : Quit\n" 108 | " + Any other key : Change rendering type\n\n"); std::fflush(stderr); 109 | const char *const title = "Image viewed as a surface"; 110 | CImgDisplay disp(800,600,title,0); 111 | unsigned int rtype = 2; 112 | CImg pose = CImg::identity_matrix(4); 113 | 114 | while (!disp.is_closed()) { 115 | const unsigned char white[3]={ 255, 255, 255 }; 116 | CImg visu(disp.width(),disp.height(),1,3,0); 117 | visu.draw_text(10,10,"%s",white,0,1,24, 118 | rtype==0?"Points":(rtype==1?"Lines":(rtype==2?"Faces":(rtype==3?"Flat-shaded faces": 119 | (rtype==4?"Gouraud-shaded faces":(rtype==5?"Phong-shaded faces":"Isophotes")))))); 120 | static bool first_time = true; 121 | if (rtype==6) visu.display_object3d(disp,isopoints,isoprimitives,isocolors,first_time,1,-1,true, 122 | 500.0f,0.0f,0.0f,-5000.0f,0.0f,0.0f,true,pose.data(),true); 123 | else visu.display_object3d(disp,points,primitives,colors,first_time,rtype,-1,true, 124 | 500.0f,0.0f,0.0f,-5000.0f,0.0f,0.0f,true,pose.data(),true); 125 | first_time = false; 126 | switch (disp.key()) { 127 | case 0: break; 128 | case cimg::keyBACKSPACE: rtype = (7 + rtype - 1)%7; break; 129 | case cimg::keyQ: 130 | case cimg::keyESC: disp.close(); break; 131 | case cimg::keyF: 132 | if (disp.is_fullscreen()) disp.resize(800,600); else disp.resize(disp.screen_width(),disp.screen_height()); 133 | disp.toggle_fullscreen(); 134 | break; 135 | default: rtype = (rtype + 1)%7; break; 136 | } 137 | } 138 | 139 | return 0; 140 | } 141 | -------------------------------------------------------------------------------- /examples/img/logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/examples/img/logo.bmp -------------------------------------------------------------------------------- /examples/img/milla.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/examples/img/milla.bmp -------------------------------------------------------------------------------- /examples/img/parrot.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/examples/img/parrot.ppm -------------------------------------------------------------------------------- /examples/img/parrot_mask.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/examples/img/parrot_mask.pgm -------------------------------------------------------------------------------- /examples/img/sh0r.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/examples/img/sh0r.pgm -------------------------------------------------------------------------------- /examples/img/sh1r.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/examples/img/sh1r.pgm -------------------------------------------------------------------------------- /examples/mcf_levelsets2d.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : mcf_levelsets2d.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Implementation of the Mean Curvature Flow on a 2D curve, 7 | # using the framework of Level Sets. 8 | # This file is a part of the CImg Library project. 9 | # ( http://cimg.eu ) 10 | # 11 | # Copyright : David Tschumperlé 12 | # ( http://tschumperle.users.greyc.fr/ ) 13 | # 14 | # License : CeCILL v2.0 15 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 16 | # 17 | # This software is governed by the CeCILL license under French law and 18 | # abiding by the rules of distribution of free software. You can use, 19 | # modify and/ or redistribute the software under the terms of the CeCILL 20 | # license as circulated by CEA, CNRS and INRIA at the following URL 21 | # "http://www.cecill.info". 22 | # 23 | # As a counterpart to the access to the source code and rights to copy, 24 | # modify and redistribute granted by the license, users are provided only 25 | # with a limited warranty and the software's author, the holder of the 26 | # economic rights, and the successive licensors have only limited 27 | # liability. 28 | # 29 | # In this respect, the user's attention is drawn to the risks associated 30 | # with loading, using, modifying and/or developing or reproducing the 31 | # software by the user in light of its specific status of free software, 32 | # that may mean that it is complicated to manipulate, and that also 33 | # therefore means that it is reserved for developers and experienced 34 | # professionals having in-depth computer knowledge. Users are therefore 35 | # encouraged to load and test the software's suitability as regards their 36 | # requirements in conditions enabling the security of their systems and/or 37 | # data to be ensured and, more generally, to use and operate it in the 38 | # same conditions as regards security. 39 | # 40 | # The fact that you are presently reading this means that you have had 41 | # knowledge of the CeCILL license and that you accept its terms. 42 | # 43 | */ 44 | 45 | #include "CImg.h" 46 | using namespace cimg_library; 47 | #undef min 48 | #undef max 49 | 50 | // Retrieve the curve corresponding to the zero level set of the distance function. 51 | template 52 | CImg get_level0(const CImg& img) { 53 | CImg dest(img); 54 | CImg_2x2(I,T); Inn = 0; 55 | cimg_for2x2(img,x,y,0,0,I,T) if (Icc*Inc<0 || Icc*Icn<0) dest(x,y) = 255; else dest(x,y) = Icc<0?100:0; 56 | return dest; 57 | } 58 | 59 | /*-------------------- 60 | 61 | Main procedure 62 | 63 | ----------------------*/ 64 | int main(int argc,char **argv) { 65 | cimg_usage("Perform a Mean Curvature Flow on closed curves, using Level Sets"); 66 | const float dt = cimg_option("-dt",0.8f,"PDE time step"); 67 | const unsigned int nb_iterations = cimg_option("-iter",10000,"Number of iterations"); 68 | 69 | // Create a user-defined closed curve. 70 | CImg curve(256,256,1,2,0); 71 | unsigned char col1[] = {0,255}, col2[] = {200,255}, col3[] = {255,255}; 72 | curve.draw_grid(20,20,0,0,false,false,col1,0.4f,0xCCCCCCCC,0xCCCCCCCC). 73 | draw_text(5,5,"Please draw your curve\nin this window\n(Use your mouse)",col1); 74 | CImgDisplay disp(curve,"Mean curvature flow",0); 75 | int xo = -1, yo = -1, x0 = -1, y0 = -1, x1 = -1, y1 = -1; 76 | while (!disp.is_closed() && (x0<0 || disp.button())) { 77 | if (disp.button() && disp.mouse_x()>=0 && disp.mouse_y()>=0) { 78 | if (x0<0) { xo = x0 = disp.mouse_x(); yo = y0 = disp.mouse_y(); } else { 79 | x1 = disp.mouse_x(); y1 = disp.mouse_y(); 80 | curve.draw_line(x0,y0,x1,y1,col2).display(disp); 81 | x0 = x1; y0 = y1; 82 | } 83 | } 84 | disp.wait(); 85 | if (disp.is_resized()) disp.resize(disp); 86 | } 87 | curve.draw_line(x1,y1,xo,yo,col2).channel(0).draw_fill(0,0,col3); 88 | CImg<> img = CImg<>(curve.get_shared_channel(0)).normalize(-1,1); 89 | 90 | // Perform the "Mean Curvature Flow". 91 | img.distance_eikonal(10); 92 | CImg_3x3(I,float); 93 | for (unsigned int iteration = 0; iteration velocity(img.width(),img.height(),img.depth(),img.spectrum()); 96 | float *ptrd = velocity.data(), veloc_max = 0; 97 | cimg_for3x3(img,x,y,0,0,I,float) { 98 | const float 99 | ix = (Inc - Ipc)/2, 100 | iy = (Icn - Icp)/2, 101 | ixx = Inc + Ipc - 2*Icc, 102 | iyy = Icn + Icp - 2*Icc, 103 | ixy = (Ipp + Inn - Inp - Ipn)/4, 104 | ngrad = ix*ix + iy*iy, 105 | iee = (ngrad>1e-5)?((iy*iy*ixx - 2*ix*iy*ixy + ix*ix*iyy)/ngrad):0; 106 | *(ptrd++) = iee; 107 | if (iee>veloc_max) veloc_max = iee; else if (-iee>veloc_max) veloc_max = -iee; 108 | } 109 | if (veloc_max>0) img+=(velocity*=dt/veloc_max); 110 | if (!(iteration%10)) { 111 | get_level0(img).resize(disp.width(),disp.height()). 112 | draw_grid(20,20,0,0,false,false,col3,0.4f,0xCCCCCCCC,0xCCCCCCCC). 113 | draw_text(5,5,"Iteration %d",col3,0,1,13,iteration).display(disp); 114 | } 115 | if (!(iteration%60)) img.distance_eikonal(1,3); 116 | if (disp.is_resized()) disp.resize(); 117 | } 118 | 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /examples/pde_heatflow2d.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : pde_heatflow2D.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : A simple Heat flow on 2D images. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : David Tschumperlé 11 | # ( http://tschumperle.users.greyc.fr/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | // Include library header file 45 | #include "CImg.h" 46 | #ifndef cimg_imagepath 47 | #define cimg_imagepath "img/" 48 | #endif 49 | #undef min 50 | #undef max 51 | 52 | // Make a simpler namespace alias if one wants to avoid 'using namespace cimg_library' 53 | namespace cil = cimg_library; 54 | 55 | // Main procedure 56 | //---------------- 57 | int main(int argc,char **argv) { 58 | 59 | // Read command line arguments, and init images and displays 60 | //----------------------------------------------------------- 61 | cimg_usage("Perform a simple Heat Flow on 2D images"); 62 | cil::CImg<> img(cimg_option("-i",cimg_imagepath "milla.bmp","Input image")), veloc(img); 63 | const double dt = cimg_option("-dt",3.0,"Adapting time step"); 64 | img. 65 | noise(cimg_option("-ng",0.0,"Add gaussian noise"),0). 66 | noise(cimg_option("-nu",0.0,"Add uniform noise"),1). 67 | noise(cimg_option("-ns",0.0,"Add Salt&Pepper noise"),2); 68 | cil::CImgDisplay profile(400,300,"Intensity Profile",0,false,true), disp(img,"Heat flow 2D",0,false,true); 69 | disp.move((cil::CImgDisplay::screen_width() - disp.width() - profile.width())/2, 70 | (cil::CImgDisplay::screen_height() - disp.height())/2); 71 | 72 | profile.move(disp.window_x() + 8 + disp.window_width(), disp.window_y()); 73 | const float fwhite[] = { 255,255,255 }; 74 | bool run_PDE = true; 75 | 76 | // Begin PDE iteration loop 77 | //------------------------- 78 | for (int iter = 0; !disp.is_closed() && !profile.is_closed() && 79 | !disp.is_keyQ() && !disp.is_keyESC() && !profile.is_keyQ() && !profile.is_keyESC();) { 80 | 81 | // Compute one iteration of PDE explicit scheme 82 | if (run_PDE) { 83 | CImg_3x3(I,float); 84 | cimg_forC(img,k) cimg_for3x3(img,x,y,0,k,I,float) veloc(x,y,k) = Inc + Ipc + Icn + Icp - 4*Icc; 85 | float m, M = veloc.max_min(m); 86 | const double xdt = dt/(M - m); 87 | img += veloc*xdt; 88 | cil::CImg<>(img).draw_text(2,2,"iter = %d",fwhite,0,1,13,iter).display(disp.wait(25)); 89 | } 90 | 91 | // Plot (R,G,B) intensity profiles and display it 92 | if (disp.mouse_x()>=0) { 93 | const int 94 | mx = disp.mouse_x(), my = disp.mouse_y(), 95 | mnx = mx*profile.width()/disp.width(); 96 | const unsigned char red[] = { 255,0,0 }, green[] = { 0,255,0 }, blue[] = { 0,0,255 }, white[] = { 255,255,255 }; 97 | cil::CImg(profile.width(),profile.height(),1,3,0). 98 | draw_graph(img.get_shared_row(my,0,0),red,1,1,0,255,0). 99 | draw_graph(img.get_shared_row(my,0,1),green,1,1,0,255,0). 100 | draw_graph(img.get_shared_row(my,0,2),blue,1,1,0,255,0). 101 | draw_line(mnx,0,mnx,profile.height() - 1,white,0.5f,cil::cimg::rol(0xFF00FF00,iter%32)). 102 | draw_text(2,2,"(x,y)=(%d,%d)",white,0,1,13,mx,my). 103 | display(profile); 104 | } 105 | 106 | // Mouse button stops/starts PDE evolution. 107 | if (disp.button() || profile.button()) { disp.set_button(); profile.set_button(); run_PDE = !run_PDE; } 108 | profile.resize(); 109 | disp.resize(disp); 110 | if (run_PDE) ++iter; 111 | } 112 | 113 | return 0; 114 | } 115 | -------------------------------------------------------------------------------- /examples/plotter1d.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : plotter1d.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : A simple math formula plotter. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : David Tschumperlé 11 | # ( http://tschumperle.users.greyc.fr/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | // Include CImg library file and use its main namespace 45 | #include "CImg.h" 46 | using namespace cimg_library; 47 | 48 | // Main procedure 49 | //---------------- 50 | int main(int argc,char **argv) { 51 | 52 | // Read command line argument. 53 | cimg_usage("Simple plotter of mathematical formulas"); 54 | const char *const formula = cimg_option("-f","sin(x/8) % cos(2*x)","Formula to plot"); 55 | const float x0 = cimg_option("-x0",-5.0f,"Minimal X-value"); 56 | const float x1 = cimg_option("-x1",5.0f,"Maximal X-value"); 57 | const int resolution = cimg_option("-r",1024,"Plot resolution"); 58 | const unsigned int nresolution = resolution>1?resolution:1024; 59 | const unsigned int plot_type = cimg_option("-p",1,"Plot type"); 60 | const unsigned int vertex_type = cimg_option("-v",1,"Vertex type"); 61 | 62 | // Create plot data. 63 | CImg values(4,nresolution,1,1,0); 64 | const unsigned int r = nresolution - 1; 65 | cimg_forY(values,X) values(0,X) = x0 + X*(x1 - x0)/r; 66 | cimg::eval(formula,values).move_to(values); 67 | 68 | // Display interactive plot window. 69 | values.display_graph(formula,plot_type,vertex_type,"X-axis",x0,x1,"Y-axis"); 70 | 71 | // Quit. 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /examples/spherical_function3d.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : spherical_function3d.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : An example that shows how to build custom 3D objects in CImg. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : David Tschumperlé 11 | # ( http://tschumperle.users.greyc.fr/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | #include "CImg.h" 45 | using namespace cimg_library; 46 | 47 | /*--------------------------- 48 | 49 | Main procedure 50 | 51 | --------------------------*/ 52 | int main() { 53 | 54 | CImgList object_colors; 55 | CImgList object_opacities; 56 | 57 | // Define a 3D centered box. 58 | CImg object_vertices = CImg(3,8,1,1, // Define the 8 vertices of the cube 59 | -1,-1,-1, // (x0,y0,z0) 60 | 1,-1,-1, // (x1,y1,z1) 61 | 1,1,-1, // ... 62 | -1,1,-1, 63 | -1,-1,1, 64 | 1,-1,1, 65 | 1,1,1, // (x6,y6,z6) 66 | -1,1,1).transpose(); // (x7,y7,z7) 67 | CImgList object_primitives(12,1,2,1,1, // Define the 12 segments of the cube 68 | 0,1, 1,2, 2,3, 3,0, 69 | 4,5, 5,6, 6,7, 7,4, 70 | 0,4, 1,5, 2,6, 3,7); 71 | object_colors.insert(object_primitives.size(),CImg::vector(32,64,255)); 72 | object_opacities.insert(object_primitives.size(),CImg::vector(0.3f)); 73 | 74 | // Define the spherical function's vertices. 75 | CImgList spherical_vertices; 76 | const float a = 1; 77 | const unsigned int na = 132, nb = 132; 78 | for (unsigned int v = 0; v::vector(altitude*x,altitude*y,altitude*z)); 88 | } 89 | 90 | // Define the spherical function's mesh. 91 | CImgList spherical_primitives; 92 | for (unsigned int vv = 0; vv::vector(nb*vv + nu,nb*nv + uu,nb*vv + uu)); 96 | spherical_primitives.insert(CImg::vector(nb*vv + nu,nb*nv + nu,nb*nv + uu)); 97 | object_colors.insert(CImg<>::vector(0,255,255)); 98 | object_colors.insert(CImg<>::vector(100,200,255)); 99 | object_opacities.insert(2,CImg<>::vector(1)); 100 | } 101 | 102 | // Merge 3D objects together. 103 | object_vertices.append_object3d(object_primitives,spherical_vertices>'x',spherical_primitives); 104 | char title[4096] = { 0 }; 105 | std::sprintf(title,"3D Spherical Function (%u vertices, %u primitives)", 106 | object_vertices.width(),object_primitives.size()); 107 | CImgDisplay disp(640,480,title,0); 108 | CImg(disp.width(),disp.height(),1,3,220). 109 | display_object3d(disp,object_vertices,object_primitives,object_colors,object_opacities,true,4,3,false, 110 | 500,0,0,-5000,0.1f,1.5f); 111 | 112 | return 0; 113 | } 114 | -------------------------------------------------------------------------------- /examples/tutorial.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : tutorial.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : View the color profile of an image, along the X-axis. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : David Tschumperlé 11 | # ( http://tschumperle.users.greyc.fr/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | // Include CImg library file and use its main namespace 45 | #include "CImg.h" 46 | using namespace cimg_library; 47 | 48 | #ifndef cimg_imagepath 49 | #define cimg_imagepath "img/" 50 | #endif 51 | 52 | // Main procedure 53 | //---------------- 54 | int main(int argc,char **argv) { 55 | 56 | // Define program usage and read command line parameters 57 | //------------------------------------------------------- 58 | 59 | // Display program usage, when invoked from the command line with option '-h'. 60 | cimg_usage("View the color profile of an image along the X axis"); 61 | 62 | // Read image filename from the command line (or set it to "img/parrot.ppm" if option '-i' is not provided). 63 | const char* file_i = cimg_option("-i",cimg_imagepath "parrot.ppm","Input image"); 64 | 65 | // Read pre-blurring variance from the command line (or set it to 1.0 if option '-blur' is not provided). 66 | const double sigma = cimg_option("-blur",1.0,"Variance of gaussian pre-blurring"); 67 | 68 | // Init variables 69 | //---------------- 70 | 71 | // Load an image, transform it to a color image (if necessary) and blur it with the standard deviation sigma. 72 | const CImg image = CImg<>(file_i).normalize(0,255).blur((float)sigma).resize(-100,-100,1,3); 73 | 74 | // Create two display window, one for the image, the other for the color profile. 75 | CImgDisplay 76 | main_disp(image,"Color image (Try to move mouse pointer over)",0), 77 | draw_disp(500,400,"Color profile of the X-axis",0); 78 | 79 | // Define colors used to plot the profile, and a hatch to draw the vertical line 80 | unsigned int hatch = 0xF0F0F0F0; 81 | const unsigned char 82 | red[] = { 255,0,0 }, 83 | green[] = { 0,255,0 }, 84 | blue [] = { 0,0,255 }, 85 | black[] = { 0,0,0 }; 86 | 87 | // Enter event loop. This loop ends when one of the two display window is closed or 88 | // when the keys 'ESC' or 'Q' are pressed. 89 | while (!main_disp.is_closed() && !draw_disp.is_closed() && 90 | !main_disp.is_keyESC() && !draw_disp.is_keyESC() && !main_disp.is_keyQ() && !draw_disp.is_keyQ()) { 91 | 92 | // Handle display window resizing (if any) 93 | if (main_disp.is_resized()) main_disp.resize().display(image); 94 | draw_disp.resize(); 95 | 96 | if (main_disp.mouse_x()>=0 && main_disp.mouse_y()>=0) { // Mouse pointer is over the image 97 | 98 | const int 99 | xm = main_disp.mouse_x(), // X-coordinate of the mouse pointer over the image 100 | ym = main_disp.mouse_y(), // Y-coordinate of the mouse pointer over the image 101 | xl = xm*draw_disp.width()/main_disp.width(), // Corresponding X-coordinate of the hatched line 102 | x = xm*image.width()/main_disp.width(), // Corresponding X-coordinate of the pointed pixel in the image 103 | y = ym*image.height()/main_disp.height(); // Corresponding Y-coordinate of the pointex pixel in the image 104 | 105 | // Retrieve color component values at pixel (x,y) 106 | const unsigned int 107 | val_red = image(x,y,0), 108 | val_green = image(x,y,1), 109 | val_blue = image(x,y,2); 110 | 111 | // Create and display the image of the intensity profile 112 | CImg(draw_disp.width(),draw_disp.height(),1,3,255). 113 | draw_grid(-50*100.0f/image.width(),-50*100.0f/256,0,0,false,true,black,0.2f,0xCCCCCCCC,0xCCCCCCCC). 114 | draw_axes(0,image.width() - 1.0f,255.0f,0.0f,black). 115 | draw_graph(image.get_shared_row(y,0,0),red,1,1,0,255,1). 116 | draw_graph(image.get_shared_row(y,0,1),green,1,1,0,255,1). 117 | draw_graph(image.get_shared_row(y,0,2),blue,1,1,0,255,1). 118 | draw_text(30,5,"Pixel (%d,%d)={%d %d %d}",black,0,1,16, 119 | main_disp.mouse_x(),main_disp.mouse_y(),val_red,val_green,val_blue). 120 | draw_line(xl,0,xl,draw_disp.height() - 1,black,0.5f,hatch=cimg::rol(hatch)). 121 | display(draw_disp); 122 | } else 123 | // else display a text in the profile display window. 124 | CImg(draw_disp.width(),draw_disp.height()).fill(255). 125 | draw_text(draw_disp.width()/2 - 130,draw_disp.height()/2 - 5,"Mouse pointer is outside the image", 126 | black,0,1,16).display(draw_disp); 127 | 128 | // Temporize event loop 129 | cimg::wait(20); 130 | } 131 | 132 | return 0; 133 | } 134 | -------------------------------------------------------------------------------- /examples/use_RGBclass.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_RGBclass.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : A small code that shows how to write a CImg plugin to 7 | # handle color image manipulation using a user-defined RGB 8 | # class, instead of using classical pixel access of CImg 9 | # with operator(). 10 | # This file is a part of the CImg Library project. 11 | # ( http://cimg.eu ) 12 | # 13 | # Copyright : David Tschumperlé 14 | # ( http://tschumperle.users.greyc.fr/ ) 15 | # 16 | # License : CeCILL v2.0 17 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 18 | # 19 | # This software is governed by the CeCILL license under French law and 20 | # abiding by the rules of distribution of free software. You can use, 21 | # modify and/ or redistribute the software under the terms of the CeCILL 22 | # license as circulated by CEA, CNRS and INRIA at the following URL 23 | # "http://www.cecill.info". 24 | # 25 | # As a counterpart to the access to the source code and rights to copy, 26 | # modify and redistribute granted by the license, users are provided only 27 | # with a limited warranty and the software's author, the holder of the 28 | # economic rights, and the successive licensors have only limited 29 | # liability. 30 | # 31 | # In this respect, the user's attention is drawn to the risks associated 32 | # with loading, using, modifying and/or developing or reproducing the 33 | # software by the user in light of its specific status of free software, 34 | # that may mean that it is complicated to manipulate, and that also 35 | # therefore means that it is reserved for developers and experienced 36 | # professionals having in-depth computer knowledge. Users are therefore 37 | # encouraged to load and test the software's suitability as regards their 38 | # requirements in conditions enabling the security of their systems and/or 39 | # data to be ensured and, more generally, to use and operate it in the 40 | # same conditions as regards security. 41 | # 42 | # The fact that you are presently reading this means that you have had 43 | # knowledge of the CeCILL license and that you accept its terms. 44 | # 45 | */ 46 | 47 | #ifndef cimg_plugin 48 | #define cimg_plugin "examples/use_RGBclass.cpp" // Path of the plugin is relative to the CImg.h file 49 | #include "CImg.h" 50 | using namespace cimg_library; 51 | #ifndef cimg_imagepath 52 | #define cimg_imagepath "img/" 53 | #endif 54 | 55 | // Main procedure 56 | //---------------- 57 | int main() { 58 | 59 | // Load images. 60 | CImg img1(cimg_imagepath "milla.bmp"); 61 | const CImg img2 = CImg(cimg_imagepath "parrot.ppm").resize(img1,3); 62 | const float default_color[] = { 30,30,80 }; 63 | 64 | // Modify 'img1' using the RGB pixel accessor. 65 | cimg_forXY(img1,x,y) 66 | if (!((x*y)%31)) img1.RGB_at(x,y) = default_color; 67 | else if ((x+y)%2) img1.RGB_at(x,y) = img2.RGB_at(x,y); 68 | img1.display(); 69 | 70 | // Quit. 71 | return 0; 72 | } 73 | 74 | #else 75 | 76 | //------------------------- 77 | // Start of the plugin code 78 | //------------------------- 79 | 80 | // Define a simple structure of *references* to R,G,B values. 81 | //----------------------------------------------------------- 82 | // (Feel free to add your own operators in there !) 83 | struct st_RGB { 84 | T _R,_G,_B,&R,&G,&B; 85 | 86 | // Construct from R,G,B references of values. 87 | st_RGB(const T& nR, const T& nG, const T& nB):_R(nR),_G(nG),_B(nB),R(_R),G(_G),B(_B) {} 88 | st_RGB(T& nR, T& nG, T& nB):R(nR),G(nG),B(nB) {} 89 | 90 | // Copy constructors. 91 | st_RGB(const st_RGB& rgb):_R(rgb.R),_G(rgb.G),_B(rgb.B),R(_R),G(_G),B(_B) {} 92 | template 93 | st_RGB(const t& rgb):_R(rgb[0]),_G(rgb[1]),_B(rgb[2]) {} 94 | 95 | // Assignement operator. 96 | st_RGB& operator=(const st_RGB& rgb) { 97 | R = (T)(rgb[0]); G = (T)(rgb[1]); B = (T)(rgb[2]); 98 | return *this; 99 | } 100 | template 101 | st_RGB& operator=(const t& rgb) { 102 | R = (T)(rgb[0]); G = (T)(rgb[1]); B = (T)(rgb[2]); 103 | return *this; 104 | } 105 | 106 | // Data (R,G or B) access operator. 107 | const T& operator[](const unsigned int i) const { 108 | return i==2?B:(i==1?G:R); 109 | } 110 | T& operator[](const unsigned int i) { 111 | return i==2?B:(i==1?G:R); 112 | } 113 | 114 | // Print instance on the standard error. 115 | const st_RGB& print() const { 116 | std::fprintf(stderr,"{ %d %d %d }\n",(int)R,(int)G,(int)B); 117 | return *this; 118 | } 119 | }; 120 | 121 | // Define CImg member functions which return pixel values as st_RGB instances. 122 | //-------------------------------------------------------------------------------- 123 | const st_RGB RGB_at(const int x, const int y=0, const int z=0) const { 124 | const int whz = width()*height()*depth(); 125 | const T *const pR = data() + x + y*width() + z*width()*height(), *const pG = pR + whz, *const pB = pG + whz; 126 | return st_RGB(*pR,*pG,*pB); 127 | } 128 | 129 | st_RGB RGB_at(const int x, const int y=0, const int z=0) { 130 | const int whz = width()*height()*depth(); 131 | T *const pR = data() + x + y*width() + z*width()*height(), *const pG = pR + whz, *const pB = pG + whz; 132 | return st_RGB(*pR,*pG,*pB); 133 | } 134 | 135 | //------------------------ 136 | // End of the plugin code 137 | //------------------------ 138 | #endif 139 | -------------------------------------------------------------------------------- /examples/use_chlpca.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_chlpca.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/chlpca.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Jerome Boulanger 11 | # ( http://www.irisa.fr/vista/Equipe/People/Jerome.Boulanger.html ) 12 | # 13 | # 14 | # License : CeCILL v2.0 15 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 16 | # 17 | # This software is governed by the CeCILL license under French law and 18 | # abiding by the rules of distribution of free software. You can use, 19 | # modify and/ or redistribute the software under the terms of the CeCILL 20 | # license as circulated by CEA, CNRS and INRIA at the following URL 21 | # "http://www.cecill.info". 22 | # 23 | # As a counterpart to the access to the source code and rights to copy, 24 | # modify and redistribute granted by the license, users are provided only 25 | # with a limited warranty and the software's author, the holder of the 26 | # economic rights, and the successive licensors have only limited 27 | # liability. 28 | # 29 | # In this respect, the user's attention is drawn to the risks associated 30 | # with loading, using, modifying and/or developing or reproducing the 31 | # software by the user in light of its specific status of free software, 32 | # that may mean that it is complicated to manipulate, and that also 33 | # therefore means that it is reserved for developers and experienced 34 | # professionals having in-depth computer knowledge. Users are therefore 35 | # encouraged to load and test the software's suitability as regards their 36 | # requirements in conditions enabling the security of their systems and/or 37 | # data to be ensured and, more generally, to use and operate it in the 38 | # same conditions as regards security. 39 | # 40 | # The fact that you are presently reading this means that you have had 41 | # knowledge of the CeCILL license and that you accept its terms. 42 | # 43 | */ 44 | 45 | #define cimg_plugin "plugins/chlpca.h" 46 | #include "CImg.h" 47 | using namespace cimg_library; 48 | #ifndef cimg_imagepath 49 | #define cimg_imagepath "img/" 50 | #endif 51 | 52 | // Main procedure 53 | //---------------- 54 | int main(int argc,char **argv) { 55 | cimg_usage("Patch based denoising "); 56 | const char *file_i = cimg_option("-i",cimg_imagepath "milla.bmp","Input image"); 57 | const int p = cimg_option("-p",3,"patch radius"); 58 | const int w = cimg_option("-w",10,"window radius"); 59 | const float lambda_min = cimg_option("-l",(float)2.f,"component selection threshold"); 60 | const int nstep = cimg_option("-nstep",5,"sub-sampling"); 61 | const float nsim = cimg_option("-nsim",(float)5.f,"dictionnary size a multiple of the patch size"); 62 | const float noise_std = cimg_option("-sigma",(float)-1.f,"noise std (-1:estimated)"); 63 | const bool use_svd = cimg_option("-svd",(float)-1.f,"use svd for computing PCA"); 64 | const char *file_o = cimg_option("-o",(char*)NULL,"Output file"); 65 | CImg<> img(file_i); 66 | img = img.get_chlpca(p, w, nstep, nsim, lambda_min, noise_std, use_svd); 67 | img.display(); 68 | if (file_o) img.save(file_o); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /examples/use_cimgIPL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_cimgIPL.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/cimgIPL.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : newleft (haibo.zheng@gmail.com) 11 | # newleftist@hotmail.com 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #pragma comment(lib, "cv.lib") 49 | #pragma comment(lib, "cvaux.lib") 50 | #pragma comment(lib, "cxcore.lib") 51 | #pragma comment(lib, "highgui.lib") 52 | 53 | #define cimg_plugin1 "plugins\cimgIPL.h" 54 | #include "CImg.h" 55 | using namespace cimg_library; 56 | 57 | // Main procedure 58 | //---------------- 59 | int main(int argc, char* argv[]) { 60 | int wid = 0; 61 | CImg<> cImg(argv[1]); 62 | cImg.display("cImg"); 63 | IplImage* ipl; 64 | //ipl = cvLoadImage(argv[1], -1); 65 | ipl = cImg.get_IPL(); 66 | 67 | IplImage *ipl8; 68 | IplImage *ipl16, *ipl32, *ipl64; 69 | IplImage *ipl16to8, *ipl32to8, *ipl64to8; 70 | cvNamedWindow("origin", wid++); 71 | cvNamedWindow("8bit_OK", wid++); 72 | cvNamedWindow("16bit", wid++); 73 | cvNamedWindow("32bit", wid++); 74 | cvNamedWindow("64bit", wid++); 75 | cvNamedWindow("16bitto8", wid++); 76 | cvNamedWindow("32bitto8", wid++); 77 | cvNamedWindow("64bitto8", wid++); 78 | 79 | cvShowImage("origin", ipl); 80 | 81 | ipl8 = cvCreateImage(cvGetSize(ipl), IPL_DEPTH_8U, ipl->nChannels); 82 | cvConvert(ipl, ipl8); 83 | 84 | ipl16 = cvCreateImage(cvGetSize(ipl), IPL_DEPTH_16U, ipl->nChannels); 85 | cvConvert(ipl, ipl16); 86 | 87 | ipl32 = cvCreateImage(cvGetSize(ipl), IPL_DEPTH_32F, ipl->nChannels); 88 | cvConvert(ipl, ipl32); 89 | 90 | ipl64 = cvCreateImage(cvGetSize(ipl), IPL_DEPTH_64F, ipl->nChannels); 91 | cvConvert(ipl, ipl64); 92 | 93 | cvShowImage("8bit_OK", ipl8);// this canbe show properly 94 | cvShowImage("16bit", ipl16);// maynot display properly, that's bug of cvShowImage 95 | cvShowImage("32bit", ipl32);// maynot display properly, that's bug of cvShowImage 96 | cvShowImage("64bit", ipl64);// maynot display properly, that's bug of cvShowImage 97 | 98 | // cvShowImage can only display IplImage with IPL_DEPTH_8X, proved by the following codes 99 | ipl16to8 = cvCreateImage(cvGetSize(ipl16), IPL_DEPTH_8U, ipl16->nChannels); 100 | cvConvert(ipl16, ipl16to8); 101 | ipl32to8 = cvCreateImage(cvGetSize(ipl32), IPL_DEPTH_8U, ipl32->nChannels); 102 | cvConvert(ipl32, ipl32to8); 103 | ipl64to8 = cvCreateImage(cvGetSize(ipl64), IPL_DEPTH_8U, ipl64->nChannels); 104 | cvConvert(ipl64, ipl64to8); 105 | cvShowImage("16bitto8", ipl16to8); // diplay ok 106 | cvShowImage("32bitto8", ipl32to8); // diplay ok 107 | cvShowImage("64bitto8", ipl64to8); // diplay ok 108 | 109 | // now, we test ipl8->cImg, ipl16->cImg, ipl32->cImg, ipl64->cImg 110 | cImg.assign(ipl8); 111 | cImg.display("ipl8->cimg"); 112 | cImg.assign(ipl16); 113 | cImg.display("ipl16->cimg"); 114 | cImg.assign(ipl32); 115 | cImg.display("ipl32->cimg"); 116 | cImg.assign(ipl64); 117 | cImg.display("ipl64->cimg"); 118 | 119 | cvWaitKey(0); 120 | 121 | // test another construct 122 | CImg testCImg1(ipl16); 123 | testCImg1.display("testCImg1"); 124 | CImg testCImg2(ipl32); 125 | testCImg2.display("testCImg2"); 126 | CImg testCImg3(ipl64); 127 | testCImg3.display("testCImg3"); 128 | 129 | CImg testCImg4(ipl16); 130 | testCImg4.display("testCImg4"); 131 | CImg testCImg5(ipl32); 132 | testCImg5.display("testCImg5"); 133 | CImg testCImg6(ipl64); 134 | testCImg6.display("testCImg6"); 135 | 136 | cvReleaseImage(&ipl); 137 | cvReleaseImage(&ipl8); 138 | cvReleaseImage(&ipl16); 139 | cvReleaseImage(&ipl32); 140 | cvReleaseImage(&ipl64); 141 | cvReleaseImage(&ipl16to8); 142 | cvReleaseImage(&ipl32to8); 143 | cvReleaseImage(&ipl64to8); 144 | 145 | cvDestroyWindow("origin"); 146 | cvDestroyWindow("8bit_OK"); 147 | cvDestroyWindow("16bit"); 148 | cvDestroyWindow("32bit"); 149 | cvDestroyWindow("64bit"); 150 | cvDestroyWindow("16bitto8"); 151 | cvDestroyWindow("32bitto8"); 152 | cvDestroyWindow("64bitto8"); 153 | 154 | return 0; 155 | } 156 | -------------------------------------------------------------------------------- /examples/use_cimgmatlab.cpp: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | 3 | File : use_cimgmatlab.cpp 4 | 5 | Description: Example of use for the CImg plugin 'plugins/cimgmatlab.h' 6 | which allows to use CImg in order to develop matlab external 7 | functions (mex functions). 8 | User should be familiar with Matlab C/C++ mex function concepts, 9 | as this file is by no way a mex programming tutorial. 10 | 11 | This simple example implements a mex function that can be called 12 | as 13 | 14 | - v = cimgmatlab_cannyderiche(u,s) 15 | - v = cimgmatlab_cannyderiche(u,sx,sy) 16 | - v = cimgmatlab_cannyderiche(u,sx,sy,sz) 17 | 18 | The corresponding m-file is cimgmatlab_cannyderiche.m 19 | 20 | 21 | Copyright : Francois Lauze - http://www.itu.dk/people/francois 22 | This software is governed by the Gnu Lesser General Public License 23 | see http://www.gnu.org/copyleft/lgpl.html 24 | 25 | The plugin home page is at 26 | http://www.itu.dk/people/francois/cimgmatlab.html 27 | 28 | for the compilation: using the mex utility provided with matlab, just 29 | remember to add the -I flags with paths to CImg.h and/or cimgmatlab.h. 30 | The default lcc cannot be used, it is a C compiler and not a C++ one! 31 | 32 | --------------------------------------------------------------------------*/ 33 | 34 | #include 35 | #define cimg_plugin "plugins/cimgmatlab.h" 36 | #include 37 | 38 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { 39 | if (nrhs < 2) mexErrMsgTxt("No enough input arguments."); 40 | if (nrhs > 4) mexErrMsgTxt("Too many input arguments."); 41 | cimg_library::CImg<> u(prhs[0],true); 42 | if (nrhs == 2) { 43 | const float s = (float)mxGetScalar(prhs[1]); 44 | plhs[0] = u.get_blur(s).toMatlab(); 45 | } else if (nrhs == 3) { 46 | const float sx = (float)mxGetScalar(prhs[1]); 47 | const float sy = (float)mxGetScalar(prhs[2]); 48 | plhs[0] = u.get_blur(sx,sy,0).toMatlab(); 49 | } else if (nrhs == 4) { 50 | const float sx = (float)mxGetScalar(prhs[1]); 51 | const float sy = (float)mxGetScalar(prhs[2]); 52 | const float sz = (float)mxGetScalar(prhs[3]); 53 | plhs[0] = u.get_blur(sx,sy,sz).toMatlab(); 54 | } 55 | } 56 | 57 | /*------------------------------------------------------------------ 58 | 59 | SPECIAL NOTE : 60 | ------------- 61 | 62 | How to read a .mat file using plugin 'cimgmatlab.h' ? 63 | (contribution by Vo Duc Khanh/Denso IT Lab, Tokyo, Japan). 64 | 65 | #include 66 | #include 67 | #include 68 | 69 | #define cimg_plugin "cimgmatlab.h" 70 | 71 | #include "CImg.h" 72 | #include 73 | #include 74 | 75 | ......... 76 | 77 | using namespace cimg_library; 78 | using namespace std; 79 | 80 | // Load input images (125700 images) from training database 'BmpTrainingDb.mat' 81 | MATFile *pmat, *pmat_out; 82 | mxArray *pa, *pa_out; 83 | const char data_path[256] = ".\\BmpTrainingDb.mat\0"; 84 | const char *var_name; 85 | 86 | pmat = matOpen(data_path, "r"); 87 | if (pmat == NULL) { 88 | cout << "Error opening file " << data_path << endl; 89 | return (1); 90 | } 91 | 92 | pa = matGetNextVariable(pmat, &var_name); 93 | if (pa == NULL){ 94 | cout << "Error reading in file " << data_path << endl; 95 | return (1); 96 | } 97 | 98 | CImg train_db(pa,false); 99 | ........ 100 | 101 | 102 | -----------------------------------------------------------------------------*/ 103 | -------------------------------------------------------------------------------- /examples/use_cimgmatlab.m: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | File : use_cimgmatlab.m 3 | 4 | Description: Example of use for the CImg plugin 'plugins/cimgmatlab.h' 5 | which allows to use CImg in order to develop matlab external 6 | functions (mex functions). 7 | User should be familiar with Matlab C/C++ mex function concepts, 8 | as this file is by no way a mex programming tutorial. 9 | 10 | This simple example implements a mex function that can be called 11 | as 12 | 13 | - v = cimgmatlab_cannyderiche(u,s) 14 | - v = cimgmatlab_cannyderiche(u,sx,sy) 15 | - v = cimgmatlab_cannyderiche(u,sx,sy,sz) 16 | 17 | The corresponding m-file is cimgmatlab_cannyderiche.m 18 | 19 | 20 | Copyright : Francois Lauze - http://www.itu.dk/people/francois 21 | This software is governed by the Gnu General Public License 22 | see http://www.gnu.org/copyleft/gpl.html 23 | 24 | The plugin home page is at 25 | http://www.itu.dk/people/francois/cimgmatlab.html 26 | 27 | for the compilation: using the mex utility provided with matlab, just 28 | remember to add the -I flags with paths to CImg.h and/or cimgmatlab.h. 29 | The default lcc cannot be used, it is a C compiler and not a C++ one! 30 | --------------------------------------------------------------------------*/ 31 | 32 | function v = cimgmatlab_cannyderiche(u,sx,sy,sz) 33 | 34 | -------------------------------------------------------------------------------- /examples/use_draw_gradient.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_draw_gradient.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/draw_gradient.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Jerome Boulanger 11 | # ( http://www.ricam.oeaw.ac.at/people/page.cgi?firstn=Jerome;lastn=Boulanger ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | #define cimg_plugin "plugins/draw_gradient.h" 45 | #include "CImg.h" 46 | using namespace cimg_library; 47 | 48 | // Main procedure 49 | //--------------- 50 | int main(int argc,char **argv) { 51 | 52 | // Read command line arguments 53 | //---------------------------- 54 | cimg_usage("Example of the use of draw_gradient CImg plugin"); 55 | const char *const file_i = cimg_option("-i",(char*)0,"Input image"); 56 | const int shape = cimg_option("-s",1,"shape [0,6]"); 57 | const int profile = cimg_option("-p",0,"profile [0,7]"); 58 | 59 | // Define an image 60 | CImg img; 61 | if (file_i) img.load(file_i).resize(-100,-100,-100,3); 62 | else img.assign(300,200,1,3,0); 63 | 64 | // Define the color of the gradient 65 | CImg col(3); 66 | const unsigned char col1[3] = { 0,0,255 }, col2[3] = { 255,255,255 }; 67 | CImgDisplay disp(img,"Click and drag to create color gradient",0); 68 | while (!disp.is_closed() && !disp.key()) { 69 | 70 | // Get a vector direction from the user. 71 | const CImg selection = img.get_select(disp,1); 72 | 73 | // Draw a gradient using the selected coordinated. 74 | col.rand(100,255); 75 | printf("Gradient with %s from color (%d,%d,%d) to (%d,%d,%d)\n", 76 | CImg<>::get_gradient_str(shape,profile),col(0),col(1),col(2),col1[0],col1[1],col2[2]); 77 | img.draw_gradient(selection(0),selection(1),selection(3),selection(4), 78 | col.data(),col1,shape,profile,.7f).display(disp); 79 | } 80 | 81 | // color 0 to transparency 82 | if (file_i) img.load(file_i).resize(-100,-100,-100,3); 83 | else img.assign(300,200,1,3,0); 84 | img.display(disp); 85 | disp.show().flush(); 86 | while (!disp.is_closed() && !disp.key()) { 87 | 88 | // Get a vector direction from the user. 89 | const CImg selection = img.get_select(disp,1); 90 | 91 | // Draw a gradient using the selected coordinated. 92 | col.rand(100,255); 93 | printf("Gradient with %s from color (%d,%d,%d) to transparency\n", 94 | CImg<>::get_gradient_str(shape,profile),col(0),col(1),col(2)); 95 | img.draw_gradient(selection(0),selection(1),selection(3),selection(4), 96 | col.data(),0,shape,profile,.7f).display(disp); 97 | } 98 | 99 | 100 | // transparency to color 1 101 | if (file_i) img.load(file_i).resize(-100,-100,-100,3); 102 | else img.assign(300,200,1,3,0); 103 | img.display(disp); 104 | disp.show().flush(); 105 | while (!disp.is_closed() && !disp.key()) { 106 | 107 | // Get a vector direction from the user. 108 | const CImg selection = img.get_select(disp,1); 109 | 110 | // Draw a gradient using the selected coordinated. 111 | col.rand(100,255); 112 | printf("Gradient with %s from transparency to color (%d,%d,%d)\n", 113 | CImg<>::get_gradient_str(shape,profile),col(0),col(1),col(2)); 114 | img.draw_gradient(selection(0),selection(1),selection(3),selection(4), 115 | 0,col.data(),shape,profile,.7f).display(disp); 116 | } 117 | 118 | // random 119 | if (file_i) img.load(file_i).resize(-100,-100,-100,3); 120 | else img.assign(300,200,1,3,0); 121 | disp.set_title("Random color gradient").show().flush(); 122 | CImg visu(img); 123 | visu.display(disp); 124 | while (!disp.is_closed() && !disp.key()) { 125 | const int 126 | x = (int)(cimg::rand()*visu.width()), 127 | y = (int)(cimg::rand()*visu.height()), 128 | rx = (int)((cimg::rand()*25 + 5)*(cimg::rand()>.5?-1:1)), 129 | ry = (int)((cimg::rand()*25 + 5)*(cimg::rand()>.5?-1:1)); 130 | col.rand(64,255); 131 | img.draw_gradient(x,y,x + rx,y + ry,col.data(),0,shape,profile,.4f); 132 | visu = img; 133 | visu.draw_text(10,10,"%.1ffps",col2,0,1,13,disp.frames_per_second()).display(disp); 134 | if (disp.is_resized()) disp.resize(); 135 | } 136 | 137 | return 0; 138 | } 139 | -------------------------------------------------------------------------------- /examples/use_jpeg_buffer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_jpeg_buffer.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/jpeg_buffer.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Paolo Prete 11 | # ( p4olo_prete(at)yahoo.it ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | // These includes are necessary to get the plug-in compile ! 45 | #include 46 | #include 47 | #include 48 | 49 | // Define plugin and include the CImg Library. 50 | #define cimg_plugin "plugins/jpeg_buffer.h" 51 | #include "CImg.h" 52 | using namespace cimg_library; 53 | 54 | // Main procedure 55 | //---------------- 56 | int main() { 57 | 58 | // Create a jpeg memory buffer from the content of a jpeg file. 59 | // (this is for testing purposes only) 60 | const char *filename_input = "foo.jpg"; 61 | std::fprintf(stderr," - Reading file '%s'\n",filename_input); 62 | std::FILE *file_input = std::fopen(filename_input,"rb"); 63 | if (!file_input) { std::fprintf(stderr,"Input JPEG file not found !"); std::exit(0); } 64 | 65 | std::fprintf(stderr," - Construct input JPEG-coded buffer\n"); 66 | unsigned buf_size = 500000; // Put the file size here ! 67 | JOCTET *buffer_input = new JOCTET[buf_size]; 68 | if (std::fread(buffer_input,sizeof(JOCTET),buf_size,file_input)) std::fclose(file_input); 69 | // -> 'buffer_input' is now a valid jpeg-coded memory buffer. 70 | 71 | // Create a CImg instance from the jpeg-coded buffer using the plug-in function. 72 | std::fprintf(stderr," - Create CImg instance from JPEG-coded buffer\n"); 73 | CImg img; 74 | img.load_jpeg_buffer(buffer_input, buf_size); 75 | delete[] buffer_input; 76 | 77 | // Do you image processing stuff here .... 78 | // Here, we just mirror the image and write "hello". 79 | std::fprintf(stderr," - Do simple processing\n"); 80 | const unsigned char purple[] = { 255, 0, 0 }; 81 | const unsigned char black[] = { 0, 0, 0 }; 82 | img.mirror('y').draw_text(0,0," Hello! ",purple,black,1,57); 83 | 84 | // Display image to see if everything's fine. 85 | img.display("Using 'jpeg_buffer.h' plugin"); 86 | 87 | // Define a new JOCTET array where the processed image has to be saved 88 | // (we don't know its dimension before compressing it, therefore we have to allocate enough memory ) 89 | std::fprintf(stderr," - Construct output JPEG-coded buffer\n"); 90 | JOCTET *buffer_output = new JOCTET[2*buf_size]; 91 | 92 | // Save processed image into this JOCTET buffer, compressed as jpeg. 93 | // This is done again by using the plug-in function. 94 | img.save_jpeg_buffer(buffer_output,buf_size,60); 95 | // Note that here, the variable 'buf_size' contains the length of the 96 | // data which have been written in the given output buffer. 97 | 98 | // Copy the content of the above array into a new file 99 | // (it should give you a valid JPEG file then !) 100 | const char *filename_output = "foo_output.jpg"; 101 | std::fprintf(stderr," - Save output file '%s'\n",filename_output); 102 | std::FILE* file_output = std::fopen(filename_output,"wb"); 103 | std::fwrite(buffer_output, sizeof(JOCTET), buf_size, file_output); 104 | std::fclose(file_output); 105 | delete[] buffer_output; 106 | 107 | std::fprintf(stderr," - All done !\n"); 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /examples/use_nlmeans.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_nlmeans.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/nlmeans.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Jerome Boulanger 11 | # ( http://www.irisa.fr/vista/Equipe/People/Jerome.Boulanger.html ) 12 | # 13 | # Benchmark : (CPU intel pentium 4 2.60GHz) compiled with cimg_debug=0. 14 | # patch lambda* alpha T sigma PSNR 15 | # 3x3 15 9x9 3.6s 20 28.22 16 | # 5x5 17 15x15 22.2s 20 27.91 17 | # 7x7 42 21x21 80.0s 20 28.68 18 | # 19 | # License : CeCILL v2.0 20 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 21 | # 22 | # This software is governed by the CeCILL license under French law and 23 | # abiding by the rules of distribution of free software. You can use, 24 | # modify and/ or redistribute the software under the terms of the CeCILL 25 | # license as circulated by CEA, CNRS and INRIA at the following URL 26 | # "http://www.cecill.info". 27 | # 28 | # As a counterpart to the access to the source code and rights to copy, 29 | # modify and redistribute granted by the license, users are provided only 30 | # with a limited warranty and the software's author, the holder of the 31 | # economic rights, and the successive licensors have only limited 32 | # liability. 33 | # 34 | # In this respect, the user's attention is drawn to the risks associated 35 | # with loading, using, modifying and/or developing or reproducing the 36 | # software by the user in light of its specific status of free software, 37 | # that may mean that it is complicated to manipulate, and that also 38 | # therefore means that it is reserved for developers and experienced 39 | # professionals having in-depth computer knowledge. Users are therefore 40 | # encouraged to load and test the software's suitability as regards their 41 | # requirements in conditions enabling the security of their systems and/or 42 | # data to be ensured and, more generally, to use and operate it in the 43 | # same conditions as regards security. 44 | # 45 | # The fact that you are presently reading this means that you have had 46 | # knowledge of the CeCILL license and that you accept its terms. 47 | # 48 | */ 49 | 50 | #define cimg_plugin "plugins/nlmeans.h" 51 | #include "CImg.h" 52 | using namespace cimg_library; 53 | #ifndef cimg_imagepath 54 | #define cimg_imagepath "img/" 55 | #endif 56 | 57 | // Main procedure 58 | //---------------- 59 | int main(int argc,char **argv) { 60 | 61 | // Read command line argument s 62 | //----------------------------- 63 | cimg_usage("Non-local means denoising algorithm.\n [1] Buades, A. Coll, B. and Morel, J.: A review of image " 64 | "denoising algorithms, with a new one. Multiscale Modeling and Simulation: A SIAM Interdisciplinary " 65 | "Journal 4 (2004) 490-530 \n [2] Gasser, T. Sroka,L. Jennen Steinmetz,C. Residual variance and residual " 66 | "pattern nonlinear regression. Biometrika 73 (1986) 625-659 \n Build : "); 67 | 68 | // input/output and general options 69 | const char *file_i = cimg_option("-i",cimg_imagepath "milla.bmp","Input image"); 70 | const char *file_o = cimg_option("-o",(char*)NULL,"Output file"); 71 | const double zoom = cimg_option("-zoom",1.0,"Image magnification"); 72 | const double noiseg = cimg_option("-ng",0.0,"Add gauss noise before aplying the algorithm"); 73 | const double noiseu = cimg_option("-nu",0.0,"Add uniform noise before applying the algorithm"); 74 | const double noises = cimg_option("-ns",0.0,"Add salt&pepper noise before applying the algorithm"); 75 | const unsigned int visu = cimg_option("-visu",1,"Visualization step (0=no visualization)"); 76 | 77 | // non local means options 78 | const int patch_size = cimg_option("-p",1,"Half size of the patch (2p+1)x(2p+1)"); 79 | const float lambda = (float)cimg_option("-lambda",-1.0f,"Bandwidth as defined in [1] (-1 : automatic bandwidth)"); 80 | const double sigma = cimg_option("-sigma",-1,"Noise standard deviation (-1 : robust estimation)"); 81 | const int alpha = cimg_option("-alpha",3,"Neighborhood size (3)"); 82 | const int sampling = cimg_option("-sampling",1,"Sampling of the patch (1: slow, 2: fast)"); 83 | 84 | // Read image 85 | //------------ 86 | CImg<> img; 87 | if (file_i) { 88 | img = CImg<>(file_i); 89 | if (zoom>1) 90 | img.resize((int)(img.width()*zoom),(int)(img.height()*zoom),(int)(img.depth()*zoom),-100,3); 91 | } else throw CImgException("You need to specify at least one input image (option -i)"); 92 | CImg<> original=img; 93 | 94 | // Add some noise 95 | //----------------- 96 | img.noise(noiseg,0).noise(noiseu,1).noise(noises,2); 97 | 98 | // Apply the filter 99 | //--------------------- 100 | cimg_uint64 tic = cimg::time(); 101 | CImg<> dest; 102 | dest = img.get_nlmeans(patch_size,lambda,alpha,sigma,sampling); 103 | cimg_uint64 tac = cimg::time(); 104 | 105 | // Save result 106 | //----------------- 107 | if (file_o) dest.cut(0,255.f).save(file_o); 108 | 109 | // Display (option -visu) 110 | //----------------------- 111 | if (visu){ 112 | fprintf(stderr,"Image computed in %f s \n",(float)(tac - tic)/1000.); 113 | fprintf(stderr,"The pnsr is %f \n", 114 | 20.*std::log10(255./std::sqrt( (dest - original).pow(2).sum()/original.size() ))); 115 | if (noiseg==0 && noiseu==0 && noises==0) 116 | CImgList<>(original,dest,((dest - original)*=2)+=128).display("Original + Restored + Estimated Noise"); 117 | 118 | else { 119 | CImgList<>(original,img,dest,((dest - img)*=2)+=128,((dest - original)*=2)+=128). 120 | display("Original + Noisy + Restored + Estimated Noise + Original Noise"); 121 | } 122 | } 123 | 124 | return 0; 125 | } 126 | -------------------------------------------------------------------------------- /examples/use_skeleton.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_skeleton.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/skeleton.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Francois-Xavier Dupe 11 | # ( http://www.greyc.ensicaen.fr/~fdupe/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | #include 45 | #define cimg_plugin "plugins/skeleton.h" 46 | #include "CImg.h" 47 | using namespace cimg_library; 48 | #ifndef cimg_imagepath 49 | #define cimg_imagepath "img/" 50 | #endif 51 | 52 | // Main procedure 53 | //---------------- 54 | int main (int argc, char **argv) { 55 | 56 | cimg_usage("Compute the skeleton of a shape, using Hamilton-Jacobi equations"); 57 | 58 | // Read command line arguments 59 | cimg_help("Input/Output options\n" 60 | "--------------------"); 61 | const char* file_i = cimg_option("-i",cimg_imagepath "milla.bmp","Input (black&white) image"); 62 | const int median = cimg_option("-median",0,"Apply median filter"); 63 | const bool invert = cimg_option("-inv",false,"Invert image values"); 64 | const char* file_o = cimg_option("-o",(char*)0,"Output skeleton image"); 65 | const bool display = cimg_option("-visu",true,"Display results"); 66 | 67 | cimg_help("Skeleton computation parameters\n" 68 | "-------------------------------"); 69 | const float thresh = cimg_option("-t",-0.3f,"Threshold"); 70 | const bool curve = cimg_option("-curve",false,"Create medial curve"); 71 | 72 | cimg_help("Torsello correction parameters\n" 73 | "------------------------------"); 74 | const bool correction = cimg_option("-corr",false,"Torsello correction"); 75 | const float dlt1 = 2; 76 | const float dlt2 = cimg_option("-dlt",1.0f,"Discrete step"); 77 | 78 | // Load the image (forcing it to be scalar with 2 values { 0,1 }). 79 | CImg image0(file_i), image = image0.get_norm().quantize(2).normalize(0.0f,1.0f).round(); 80 | if (median) image.blur_median(median); 81 | if (invert) (image-=1)*=-1; 82 | if (display) (image0.get_normalize(0,255),image.get_normalize(0,255)).display("Input image - Binary image"); 83 | 84 | // Compute distance map. 85 | CImgList visu; 86 | CImg distance = image.get_distance(0); 87 | if (display) visu.insert(distance); 88 | 89 | // Compute the gradient of the distance function, and the flux (divergence) of the gradient field. 90 | const CImgList grad = distance.get_gradient("xyz"); 91 | CImg flux = image.get_flux(grad,1,1); 92 | if (display) visu.insert(flux); 93 | 94 | // Use the Torsello correction of the flux if necessary. 95 | if (correction) { 96 | CImg 97 | logdensity = image.get_logdensity(distance,grad,flux,dlt1), 98 | nflux = image.get_corrected_flux(logdensity,grad,flux,dlt2); 99 | if (display) visu.insert(logdensity).insert(nflux); 100 | flux = nflux; 101 | } 102 | 103 | if (visu) { 104 | cimglist_apply(visu,normalize)(0,255); 105 | visu.display(visu.size()==2?"Distance function - Flux":"Distance function - Flux - Log-density - Corrected flux"); 106 | } 107 | 108 | // Compute the skeleton 109 | const CImg skel = image.get_skeleton(flux,distance,curve,thresh); 110 | if (display) { 111 | (image0.resize(-100,-100,1,3)*=0.7f).get_shared_channel(1)|=skel*255.0; 112 | image0.draw_image(0,0,0,0,image*255.0,0.5f).display("Image + Skeleton"); 113 | } 114 | 115 | // Save output image if necessary. 116 | if (file_o) skel.save(file_o); 117 | 118 | return 0; 119 | } 120 | -------------------------------------------------------------------------------- /examples/use_tiff_stream.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_tiff_stream.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/jpeg_buffer.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Wolf Blecher 11 | # ( Wolf.Blecher(at)sirona.com ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | 45 | #include 46 | // These includes are necessary to get the plug-in compile ! Don't forget to link with 'libtiff' and 'libtiffxx' ! 47 | #include "tiffio.h" 48 | #include "tiffio.hxx" 49 | 50 | // Define plugin and include the CImg Library. 51 | #define cimg_plugin "plugins/tiff_stream.h" 52 | #include "CImg.h" 53 | using namespace cimg_library; 54 | 55 | // Main procedure 56 | //---------------- 57 | int main() { 58 | 59 | std::ifstream inFile("input.tif", std::ifstream::in | std::ifstream::binary); 60 | std::ofstream outFile("outFile.tif", std::ofstream::out | std::ifstream::binary); 61 | 62 | if (!inFile.good()) 63 | { 64 | std::cout << "Error Reading from infile" << std::endl; 65 | } 66 | 67 | cimg_library::CImg imgIn; 68 | imgIn.load_tiff(&inFile); 69 | imgIn.display(); 70 | CImg imgOut = imgIn.save_tiff(&outFile, 2U); 71 | imgOut.display(); 72 | 73 | inFile.close(); 74 | outFile.close(); 75 | 76 | inFile.open("outFile.tif", std::ifstream::in | std::ifstream::binary); 77 | imgIn.load_tiff(&inFile); 78 | imgIn.display(); 79 | inFile.close(); 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /examples/use_tinymatwriter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : use_tinymatwriter.cpp 4 | # ( C++ source file ) 5 | # 6 | # Description : Example of use for the CImg plugin 'plugins/tinymatwriter.h'. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Jan W. Krieger 11 | # ( https://github.com/jkriege2 ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | /* 45 | This Matlab/Octave script tests the output: 46 | clear all 47 | more off 48 | 49 | subplot(2,2,1) 50 | load("mat432.mat", "-v6") 51 | disp('mat432.mat: CImg_image=') 52 | disp(CImg_image) 53 | imagesc(CImg_image(:,:,1)) 54 | colorbar 55 | 56 | subplot(2,2,2) 57 | load("mat432i16.mat", "-v6") 58 | disp('mat432i16.mat: CImg_image=') 59 | disp(CImg_image) 60 | imagesc(double(CImg_image(:,:,2))) 61 | colorbar 62 | 63 | subplot(2,2,3) 64 | load("matb.mat", "-v6") 65 | disp('matb.mat: CImg_image=') 66 | disp(CImg_image) 67 | imagesc(CImg_image(:,:,4)) 68 | colorbar 69 | */ 70 | 71 | #include 72 | #include 73 | #include "tinymatwriter.h" 74 | #include 75 | 76 | #define cimg_plugin "plugins/tinymatwriter.h" 77 | #include "../CImg.h" 78 | 79 | using namespace std; 80 | using namespace cimg_library; 81 | 82 | int main(int argc, const char** argv) { 83 | 84 | double mat432[4*3*2]= { 85 | 1,2,3, 86 | 4,5,6, 87 | 88 | 10,20,30, 89 | 40,50,60, 90 | 91 | 100,200,300, 92 | 400,500,600, 93 | 94 | 1000,2000,3000, 95 | 4000,5000,6000, 96 | }; 97 | 98 | int16_t mat432i16[4*3*2]= { 99 | 1,2,3, 100 | 4,5,6, 101 | 102 | 10,20,30, 103 | 40,50,60, 104 | 105 | 100,200,300, 106 | 400,500,600, 107 | 108 | 1000,-2000,3000, 109 | -4000,5000,-6000, 110 | }; 111 | 112 | // a boolean matrix 113 | bool matb[4*3*2] = { 114 | true,false,true, 115 | false,true,false, 116 | 117 | true,true,true, 118 | false,false,false, 119 | 120 | true,false,true, 121 | true,false,true, 122 | 123 | true,true,false, 124 | false,true,true 125 | }; 126 | 127 | cimg_library::CImg ciD(mat432, 3,2,4); 128 | cimg_library::CImg ciI16(mat432i16, 3,2,4); 129 | cimg_library::CImg ciB(matb, 3,2,4); 130 | 131 | ciD.save_tinymat("mat432.mat"); 132 | ciI16.save_tinymat("mat432i16.mat"); 133 | ciB.save_tinymat("matb.mat"); 134 | return 0; 135 | } 136 | -------------------------------------------------------------------------------- /html/CImg_reference_chinese.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/CImg_reference_chinese.pdf -------------------------------------------------------------------------------- /html/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | The CImg Library - C++ Template Image Processing Toolkit - Download 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 |

Download

25 | 26 |

27 | You have different ways to get the Library: 28 |

29 | 30 | 31 | 35 | 43 | 47 | 58 |
32 | Standard Package
36 | The Library is mainly provided as 37 | 38 | .zip package 39 | which is platform-independent. 40 | It contains all the required files, as well as various examples (which must be compiled), 41 | illustrating the use of the library functions and classes.
42 |
44 | Sources Repository
48 | You may be also more adventurous and try the current development version with git. 49 | This ensures you will get the latest code available, and will ease the 50 | updates as well. To do this, just 51 | type the command : 52 | 55 | in your favorite console. Nevertheless, you have to know that some code in the source repository 56 | is under development and may be experimental, so always test the latest stable archive before complaining ! 57 |
59 | 60 |
61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /html/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/favicon.ico -------------------------------------------------------------------------------- /html/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/favicon.png -------------------------------------------------------------------------------- /html/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | The CImg Library - C++ Template Image Processing Toolkit 7 | 8 | 9 |
10 |

11 | Copyrights (C) From october 2004, David Tschumperlé - GREYC UMR CNRS 6072, Image team.
12 | Copyrights (C) January->September 2004, David Tschumperlé.
13 | Copyrights (C) 2000->2003, David Tschumperlé - INRIA Sophia-Antipolis. Odyssée group.
14 |

15 |
16 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /html/footer_doxygen.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |

6 | Copyrights (C) From october 2004, David Tschumperlé - GREYC UMR CNRS 6072, Image team.
7 | Copyrights (C) January->September 2004, David Tschumperlé.
8 | Copyrights (C) 2000->2003, David Tschumperlé - INRIA Sophia-Antipolis. Odyssée group.
9 |

10 |
11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /html/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The CImg Library - C++ Template Image Processing Toolkit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | Logo 25 |

26 | Latest stable version: 3.5.5        Current pre-release: 3.5.6 (2025/05/29) 27 |

28 | 29 |
30 | 31 | 32 | 63 |
64 |
65 | 66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /html/header_doxygen.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The CImg Library - C++ Template Image Processing Toolkit - Reference Documentation 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 24 | 25 | 26 |
27 | Logo 28 |

29 | Latest stable version: 3.5.5        Current pre-release: 3.5.6 (2025/05/29) 30 |

31 | 32 |
33 | 34 | 35 | 66 |
67 |
68 | 69 |

Reference

70 | -------------------------------------------------------------------------------- /html/highslide/graphics/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/close.png -------------------------------------------------------------------------------- /html/highslide/graphics/closeX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/closeX.png -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar-black-border.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar-black-border.gif -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar-text-buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar-text-buttons.png -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar-white-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar-white-small.gif -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar-white.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar-white.gif -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar2.gif -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar3.gif -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar4-hover.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar4-hover.gif -------------------------------------------------------------------------------- /html/highslide/graphics/controlbar4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/controlbar4.gif -------------------------------------------------------------------------------- /html/highslide/graphics/fullexpand.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/fullexpand.gif -------------------------------------------------------------------------------- /html/highslide/graphics/geckodimmer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/geckodimmer.png -------------------------------------------------------------------------------- /html/highslide/graphics/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/icon.gif -------------------------------------------------------------------------------- /html/highslide/graphics/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/loader.gif -------------------------------------------------------------------------------- /html/highslide/graphics/loader.white.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/loader.white.gif -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/Outlines.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/Outlines.psd -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/beveled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/beveled.png -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/drop-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/drop-shadow.png -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/glossy-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/glossy-dark.png -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/outer-glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/outer-glow.png -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/rounded-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/rounded-black.png -------------------------------------------------------------------------------- /html/highslide/graphics/outlines/rounded-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/outlines/rounded-white.png -------------------------------------------------------------------------------- /html/highslide/graphics/resize.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/resize.gif -------------------------------------------------------------------------------- /html/highslide/graphics/scrollarrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/scrollarrows.png -------------------------------------------------------------------------------- /html/highslide/graphics/zoomin.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/zoomin.cur -------------------------------------------------------------------------------- /html/highslide/graphics/zoomout.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/highslide/graphics/zoomout.cur -------------------------------------------------------------------------------- /html/highslide/highslide-ie6.css: -------------------------------------------------------------------------------- 1 | .closebutton { 2 | /* NOTE! This URL is relative to the HTML page, not the CSS */ 3 | filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( 4 | src='../highslide/graphics/close.png', sizingMethod='scale'); 5 | 6 | background: none; 7 | cursor: hand; 8 | } 9 | 10 | /* Viewport fixed hack */ 11 | .highslide-viewport { 12 | position: absolute; 13 | left: expression( ( ( ignoreMe1 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); 14 | top: expression( ( ignoreMe2 = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + 'px' ); 15 | width: expression( ( ( ignoreMe3 = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) ) + 'px' ); 16 | height: expression( ( ( ignoreMe4 = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) ) + 'px' ); 17 | } 18 | 19 | /* Thumbstrip PNG fix */ 20 | .highslide-scroll-down, .highslide-scroll-up { 21 | position: relative; 22 | overflow: hidden; 23 | } 24 | .highslide-scroll-down div, .highslide-scroll-up div { 25 | /* NOTE! This URL is relative to the HTML page, not the CSS */ 26 | filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( 27 | src='../highslide/graphics/scrollarrows.png', sizingMethod='scale'); 28 | background: none !important; 29 | position: absolute; 30 | cursor: hand; 31 | width: 75px; 32 | height: 75px !important; 33 | } 34 | .highslide-thumbstrip-horizontal .highslide-scroll-down div { 35 | left: -50px; 36 | top: -15px; 37 | } 38 | .highslide-thumbstrip-horizontal .highslide-scroll-up div { 39 | top: -15px; 40 | } 41 | .highslide-thumbstrip-vertical .highslide-scroll-down div { 42 | top: -50px; 43 | } 44 | 45 | /* Thumbstrip marker arrow trasparent background fix */ 46 | .highslide-thumbstrip .highslide-marker { 47 | border-color: white; /* match the background */ 48 | } 49 | .dark .highslide-thumbstrip-horizontal .highslide-marker { 50 | border-color: #111; 51 | } 52 | .highslide-viewport .highslide-marker { 53 | border-color: #333; 54 | } 55 | .highslide-thumbstrip { 56 | float: left; 57 | } 58 | 59 | /* Positioning fixes for the control bar */ 60 | .text-controls .highslide-controls { 61 | width: 480px; 62 | } 63 | .text-controls a span { 64 | width: 4em; 65 | } 66 | .text-controls .highslide-full-expand a span { 67 | width: 0; 68 | } 69 | .text-controls .highslide-close a span { 70 | width: 0; 71 | } 72 | 73 | /* Special */ 74 | .in-page .highslide-thumbstrip-horizontal .highslide-marker { 75 | border-bottom: gray; 76 | } 77 | -------------------------------------------------------------------------------- /html/img/book_cimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/book_cimg.jpg -------------------------------------------------------------------------------- /html/img/book_cimg_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/book_cimg_en.jpg -------------------------------------------------------------------------------- /html/img/item_clickvideo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_clickvideo.jpg -------------------------------------------------------------------------------- /html/img/item_clickvideo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_clickvideo2.jpg -------------------------------------------------------------------------------- /html/img/item_description.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_description.jpg -------------------------------------------------------------------------------- /html/img/item_extensibility.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_extensibility.jpg -------------------------------------------------------------------------------- /html/img/item_file.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_file.jpg -------------------------------------------------------------------------------- /html/img/item_freedom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_freedom.jpg -------------------------------------------------------------------------------- /html/img/item_genericity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_genericity.jpg -------------------------------------------------------------------------------- /html/img/item_portability.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_portability.jpg -------------------------------------------------------------------------------- /html/img/item_simplicity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_simplicity.jpg -------------------------------------------------------------------------------- /html/img/item_sources.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_sources.jpg -------------------------------------------------------------------------------- /html/img/item_sources2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_sources2.jpg -------------------------------------------------------------------------------- /html/img/item_standard_package.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_standard_package.jpg -------------------------------------------------------------------------------- /html/img/item_standard_package2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_standard_package2.jpg -------------------------------------------------------------------------------- /html/img/item_usefulness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/item_usefulness.jpg -------------------------------------------------------------------------------- /html/img/logoCImg0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logoCImg0.png -------------------------------------------------------------------------------- /html/img/logoCNRS.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logoCNRS.gif -------------------------------------------------------------------------------- /html/img/logoGREYC.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logoGREYC.gif -------------------------------------------------------------------------------- /html/img/logoIMAGE.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logoIMAGE.gif -------------------------------------------------------------------------------- /html/img/logoINRIA.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logoINRIA.gif -------------------------------------------------------------------------------- /html/img/logoODYSSEE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logoODYSSEE.jpg -------------------------------------------------------------------------------- /html/img/logo_header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logo_header.jpg -------------------------------------------------------------------------------- /html/img/logo_header.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logo_header.xcf -------------------------------------------------------------------------------- /html/img/logo_header_old.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/logo_header_old.jpg -------------------------------------------------------------------------------- /html/img/menu_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_download.png -------------------------------------------------------------------------------- /html/img/menu_faq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_faq.png -------------------------------------------------------------------------------- /html/img/menu_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_home.png -------------------------------------------------------------------------------- /html/img/menu_issue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_issue.png -------------------------------------------------------------------------------- /html/img/menu_links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_links.png -------------------------------------------------------------------------------- /html/img/menu_reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_reference.png -------------------------------------------------------------------------------- /html/img/menu_screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_screenshots.png -------------------------------------------------------------------------------- /html/img/menu_tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/menu_tutorial.png -------------------------------------------------------------------------------- /html/img/postcard1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard1.jpg -------------------------------------------------------------------------------- /html/img/postcard10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard10.jpg -------------------------------------------------------------------------------- /html/img/postcard11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard11.jpg -------------------------------------------------------------------------------- /html/img/postcard12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard12.jpg -------------------------------------------------------------------------------- /html/img/postcard13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard13.jpg -------------------------------------------------------------------------------- /html/img/postcard14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard14.jpg -------------------------------------------------------------------------------- /html/img/postcard15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard15.jpg -------------------------------------------------------------------------------- /html/img/postcard16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard16.jpg -------------------------------------------------------------------------------- /html/img/postcard17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard17.jpg -------------------------------------------------------------------------------- /html/img/postcard18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard18.jpg -------------------------------------------------------------------------------- /html/img/postcard19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard19.jpg -------------------------------------------------------------------------------- /html/img/postcard2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard2.jpg -------------------------------------------------------------------------------- /html/img/postcard20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard20.jpg -------------------------------------------------------------------------------- /html/img/postcard21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard21.jpg -------------------------------------------------------------------------------- /html/img/postcard22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard22.jpg -------------------------------------------------------------------------------- /html/img/postcard23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard23.jpg -------------------------------------------------------------------------------- /html/img/postcard24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard24.jpg -------------------------------------------------------------------------------- /html/img/postcard25.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard25.jpg -------------------------------------------------------------------------------- /html/img/postcard26.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard26.jpg -------------------------------------------------------------------------------- /html/img/postcard27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard27.jpg -------------------------------------------------------------------------------- /html/img/postcard28.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard28.jpg -------------------------------------------------------------------------------- /html/img/postcard29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard29.jpg -------------------------------------------------------------------------------- /html/img/postcard3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard3.jpg -------------------------------------------------------------------------------- /html/img/postcard30.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard30.jpg -------------------------------------------------------------------------------- /html/img/postcard31.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard31.jpg -------------------------------------------------------------------------------- /html/img/postcard32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard32.jpg -------------------------------------------------------------------------------- /html/img/postcard33.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard33.jpg -------------------------------------------------------------------------------- /html/img/postcard34.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard34.jpg -------------------------------------------------------------------------------- /html/img/postcard35.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard35.jpg -------------------------------------------------------------------------------- /html/img/postcard36.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard36.jpg -------------------------------------------------------------------------------- /html/img/postcard37.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard37.jpg -------------------------------------------------------------------------------- /html/img/postcard38.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard38.jpg -------------------------------------------------------------------------------- /html/img/postcard39.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard39.jpg -------------------------------------------------------------------------------- /html/img/postcard4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard4.jpg -------------------------------------------------------------------------------- /html/img/postcard40.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard40.jpg -------------------------------------------------------------------------------- /html/img/postcard41.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard41.jpg -------------------------------------------------------------------------------- /html/img/postcard42.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard42.jpg -------------------------------------------------------------------------------- /html/img/postcard43.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard43.jpg -------------------------------------------------------------------------------- /html/img/postcard44.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard44.jpg -------------------------------------------------------------------------------- /html/img/postcard45.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard45.jpg -------------------------------------------------------------------------------- /html/img/postcard46.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard46.jpg -------------------------------------------------------------------------------- /html/img/postcard47.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard47.jpg -------------------------------------------------------------------------------- /html/img/postcard48.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard48.jpg -------------------------------------------------------------------------------- /html/img/postcard49.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard49.jpg -------------------------------------------------------------------------------- /html/img/postcard5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard5.jpg -------------------------------------------------------------------------------- /html/img/postcard50.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard50.jpg -------------------------------------------------------------------------------- /html/img/postcard51.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard51.jpg -------------------------------------------------------------------------------- /html/img/postcard52.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard52.jpg -------------------------------------------------------------------------------- /html/img/postcard53.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard53.jpg -------------------------------------------------------------------------------- /html/img/postcard54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard54.jpg -------------------------------------------------------------------------------- /html/img/postcard55.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard55.jpg -------------------------------------------------------------------------------- /html/img/postcard56.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard56.jpg -------------------------------------------------------------------------------- /html/img/postcard57.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard57.jpg -------------------------------------------------------------------------------- /html/img/postcard58.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard58.jpg -------------------------------------------------------------------------------- /html/img/postcard59.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard59.jpg -------------------------------------------------------------------------------- /html/img/postcard6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard6.jpg -------------------------------------------------------------------------------- /html/img/postcard60.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard60.jpg -------------------------------------------------------------------------------- /html/img/postcard61.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard61.jpg -------------------------------------------------------------------------------- /html/img/postcard62.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard62.jpg -------------------------------------------------------------------------------- /html/img/postcard63.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard63.jpg -------------------------------------------------------------------------------- /html/img/postcard64.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard64.jpg -------------------------------------------------------------------------------- /html/img/postcard65.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard65.jpg -------------------------------------------------------------------------------- /html/img/postcard66.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard66.jpg -------------------------------------------------------------------------------- /html/img/postcard67.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard67.jpg -------------------------------------------------------------------------------- /html/img/postcard68.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard68.jpg -------------------------------------------------------------------------------- /html/img/postcard69.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard69.jpg -------------------------------------------------------------------------------- /html/img/postcard7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard7.jpg -------------------------------------------------------------------------------- /html/img/postcard70.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard70.jpg -------------------------------------------------------------------------------- /html/img/postcard71.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard71.jpg -------------------------------------------------------------------------------- /html/img/postcard72.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard72.jpg -------------------------------------------------------------------------------- /html/img/postcard73.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard73.jpg -------------------------------------------------------------------------------- /html/img/postcard74.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard74.jpg -------------------------------------------------------------------------------- /html/img/postcard75.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard75.jpg -------------------------------------------------------------------------------- /html/img/postcard76.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard76.jpg -------------------------------------------------------------------------------- /html/img/postcard77.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard77.jpg -------------------------------------------------------------------------------- /html/img/postcard78.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard78.jpg -------------------------------------------------------------------------------- /html/img/postcard79.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard79.jpg -------------------------------------------------------------------------------- /html/img/postcard8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard8.jpg -------------------------------------------------------------------------------- /html/img/postcard80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard80.jpg -------------------------------------------------------------------------------- /html/img/postcard9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/postcard9.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_box3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_box3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_cool.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_cool.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_cube.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_cube.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_default.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_flag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_flag.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_hot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_hot.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_hsv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_hsv.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_jet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_jet.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_colormap_lines.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_colormap_lines.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_cone3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_cone3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_constructor1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_constructor1.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_constructor2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_constructor2.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_contrast_LUT256.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_contrast_LUT256.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_cut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_cut.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_cylinder3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_cylinder3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_default_LUT256.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_default_LUT256.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_elevation3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_elevation3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_ellipsoid3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_ellipsoid3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_equalize.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_equalize.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_histogram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_histogram.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_image.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_index.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_index.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_isoline3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_isoline3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_isosurface3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_isosurface3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_label_regions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_label_regions.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_map.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_noise.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_noise.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_norm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_norm.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_normalize.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_normalize.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_normalize2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_normalize2.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_operator_comma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_operator_comma.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_operator_eq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_operator_eq.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_operator_less.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_operator_less.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_operator_minus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_operator_minus.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_operator_plus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_operator_plus.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_operator_plus1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_operator_plus1.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_plane3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_plane3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_quantize.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_quantize.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_rainbow_LUT256.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_rainbow_LUT256.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_sphere3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_sphere3d.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_sqr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_sqr.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_sqrt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_sqrt.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_threshold.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_threshold.jpg -------------------------------------------------------------------------------- /html/img/reference/ref_torus3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/reference/ref_torus3d.jpg -------------------------------------------------------------------------------- /html/img/section_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/section_bottom.png -------------------------------------------------------------------------------- /html/img/section_bottom_mirrored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/section_bottom_mirrored.png -------------------------------------------------------------------------------- /html/img/section_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/section_middle.png -------------------------------------------------------------------------------- /html/img/section_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/section_top.png -------------------------------------------------------------------------------- /html/img/ss_blobs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_blobs.jpg -------------------------------------------------------------------------------- /html/img/ss_bubble.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_bubble.jpg -------------------------------------------------------------------------------- /html/img/ss_bump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_bump.jpg -------------------------------------------------------------------------------- /html/img/ss_demomenu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_demomenu.jpg -------------------------------------------------------------------------------- /html/img/ss_dtmri.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_dtmri.jpg -------------------------------------------------------------------------------- /html/img/ss_fourier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_fourier.jpg -------------------------------------------------------------------------------- /html/img/ss_hough.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_hough.jpg -------------------------------------------------------------------------------- /html/img/ss_imgfade.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_imgfade.jpg -------------------------------------------------------------------------------- /html/img/ss_jawbreaker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_jawbreaker.jpg -------------------------------------------------------------------------------- /html/img/ss_landscape.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_landscape.jpg -------------------------------------------------------------------------------- /html/img/ss_mandelbrot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mandelbrot.jpg -------------------------------------------------------------------------------- /html/img/ss_metaballs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_metaballs.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000000.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000001.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000002.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000003.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000004.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000005.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000006.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000007.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000008.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000009.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000010.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000011.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000012.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000013.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000014.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000015.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000016.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000017.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000018.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000019.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000020.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000021.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000022.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000023.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000024.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000025.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000026.jpg -------------------------------------------------------------------------------- /html/img/ss_mini_000027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_mini_000027.jpg -------------------------------------------------------------------------------- /html/img/ss_odykill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_odykill.jpg -------------------------------------------------------------------------------- /html/img/ss_optflow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_optflow.jpg -------------------------------------------------------------------------------- /html/img/ss_paint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_paint.jpg -------------------------------------------------------------------------------- /html/img/ss_plasma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_plasma.jpg -------------------------------------------------------------------------------- /html/img/ss_puzzle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_puzzle.jpg -------------------------------------------------------------------------------- /html/img/ss_reflection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_reflection.jpg -------------------------------------------------------------------------------- /html/img/ss_render3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_render3d.jpg -------------------------------------------------------------------------------- /html/img/ss_restoration.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_restoration.jpg -------------------------------------------------------------------------------- /html/img/ss_rotozoom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_rotozoom.jpg -------------------------------------------------------------------------------- /html/img/ss_shadebobs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_shadebobs.jpg -------------------------------------------------------------------------------- /html/img/ss_surface.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_surface.jpg -------------------------------------------------------------------------------- /html/img/ss_tetris.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_tetris.jpg -------------------------------------------------------------------------------- /html/img/ss_triangle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_triangle.jpg -------------------------------------------------------------------------------- /html/img/ss_volume3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_volume3d.jpg -------------------------------------------------------------------------------- /html/img/ss_waves.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/ss_waves.jpg -------------------------------------------------------------------------------- /html/img/tutorial.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/html/img/tutorial.jpg -------------------------------------------------------------------------------- /html/links.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | The CImg Library - C++ Template Image Processing Toolkit - Download 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 |

Links

21 | 22 |

23 | The Library is known to be used by the following projects. 24 | If you are using and want your project to appear on this page, 25 | please post a message in the forum, or contact us by e-mail. 26 |

27 |
    28 |
  • ASCOS, a correction tool for satellite images.
  • 29 |
  • Digikam, an advanced digital photo management application.
  • 30 |
  • Event Neural Assembly Simulation is an open-source C++ library to simulate so called event neural unit. Done by the INRIA lab, in France.
  • 31 |
  • GIPS and GIPPY are two new, related, open-source projects for processing of remote sensing data.
  • 32 |
  • G'MIC is an open and full-featured framework for image processing, providing several different user interfaces to convert/manipulate/filter/visualize generic image datasets, from 1d scalar signals to 3d+t sequences of multi-spectral volumetric images.
  • 33 |
  • IDIL (Integrated Data & Image Library), a cross-platform library for computing, plotting and image analysis.
  • 34 |
  • Imager is an image/video processing package for R, based on CImg.
  • 35 |
  • Inviwo is a software framework for rapid visualization prototyping.
  • 36 |
  • lwip, a light-weight image processor for NodeJS.
  • 37 |
  • MorphoGraphX is a cross-platform, open-source application for the visualization and processing of 3D biological datasets.
  • 38 |
  • Marplot is the mapping program for the CAMEO software suite, which is used widely to plan for and respond to chemical emergencies.
  • 39 |
  • Natron is a free open-source, cross-platform compositing software. It aims to produce visual effects.
  • 40 |
  • OSRA (Optical Structure Recognition Application) is a utility designed to convert graphical representations of chemical structures into SMILES (Simplified Molecular Input Line Entry Specification) or SD files - a computer recognizable molecular structure formatis a free open-source, cross-platform compositing software.
  • 41 |
  • PASIMODO, a program package for particle-based simulation methods, developed at the Institute of Engineering and Computational Mechanics (University of Stuttgart, Germany).
  • 42 |
  • pHash is an open-source software library that implements several perceptual hashing algorithms, and provides a C-like API to use those functions in your own programs.
  • 43 |
  • Photivo is an open-source photo processor. It handles your RAW files as well as bitmap files in a non-destructive 16 bit processing pipe with gimp workflow integration and batch mode.
  • 44 |
  • QuickFit 3 is a data evaluation software for FCS and imagingFCS (imFCS) measurement.
  • 45 |
  • Sofa is an open-source framework primarily targeted at real-time simulation, with an emphasis on medical simulation.
  • 46 |
  • Theia is a computer vision library aimed at providing efficient and reliable algorithms for Structure from Motion (SfM) and Simultaneous Localization and Mapping (SLAM) systems.
  • 47 |
  • Typhoon is a motion estimation program designed to retrieve vector motion fields from image sequences of turbulent flows.
  • 48 |
  • The VIPS Library uses in one of its denoising plugin.
  • 49 |
  • wxCam is a webcam application for Linux.
  • 50 |
  • XRaySim is an open-source simulation package for use in Industrial Non-Destructive testing and medical imaging applications.
  • 51 |
  • YaDICs (Yet another Digital Image Correlation software) is a free software to estimate non-rigid motion between image frames.
  • 52 |
  • ZoomFX is a free tool to help in image batch process thanks to an helpful visual interface and powerful filters.
  • 53 |
  • Other pieces of code using can be found on 54 | Github.
  • 55 |
56 | 57 |
58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /plugins/add_fileformat.h: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : add_fileformat.h 4 | # ( C++ header file - CImg plug-in ) 5 | # 6 | # Description : CImg plug-in that adds loading/saving support for a personalized 7 | # file format (determined by its extension, here ".foo"). 8 | # This file is a part of the CImg Library project. 9 | # ( http://cimg.eu ) 10 | # 11 | # Copyright : David Tschumperlé 12 | # ( http://tschumperle.users.greyc.fr/ ) 13 | # 14 | # License : CeCILL v2.0 15 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 16 | # 17 | # This software is governed by the CeCILL license under French law and 18 | # abiding by the rules of distribution of free software. You can use, 19 | # modify and/ or redistribute the software under the terms of the CeCILL 20 | # license as circulated by CEA, CNRS and INRIA at the following URL 21 | # "http://www.cecill.info". 22 | # 23 | # As a counterpart to the access to the source code and rights to copy, 24 | # modify and redistribute granted by the license, users are provided only 25 | # with a limited warranty and the software's author, the holder of the 26 | # economic rights, and the successive licensors have only limited 27 | # liability. 28 | # 29 | # In this respect, the user's attention is drawn to the risks associated 30 | # with loading, using, modifying and/or developing or reproducing the 31 | # software by the user in light of its specific status of free software, 32 | # that may mean that it is complicated to manipulate, and that also 33 | # therefore means that it is reserved for developers and experienced 34 | # professionals having in-depth computer knowledge. Users are therefore 35 | # encouraged to load and test the software's suitability as regards their 36 | # requirements in conditions enabling the security of their systems and/or 37 | # data to be ensured and, more generally, to use and operate it in the 38 | # same conditions as regards security. 39 | # 40 | # The fact that you are presently reading this means that you have had 41 | # knowledge of the CeCILL license and that you accept its terms. 42 | # 43 | */ 44 | 45 | #ifndef cimg_plugin_addfileformat 46 | #define cimg_plugin_addfileformat 47 | 48 | // These functions load ".foo" filenames 49 | //--------------------------------------- 50 | static CImg get_load_foo(const char *filename) { 51 | std::fprintf(stderr,"Load '%s' here..\n",filename); 52 | return CImg(512,512,1,3,0).noise(30); 53 | } 54 | 55 | CImg& load_foo(const char *filename) { 56 | return get_load_foo(filename).swap(*this); 57 | } 58 | 59 | // This function saves the instance image into a ".foo" file. 60 | //----------------------------------------------------------- 61 | const CImg& save_foo(const char *filename) const { 62 | std::fprintf(stderr,"Save '%s' here..\n",filename); 63 | return *this; 64 | } 65 | 66 | // The code below allows to add the support for the specified extension. 67 | //--------------------------------------------------------------------- 68 | #ifndef cimg_load_plugin 69 | #define cimg_load_plugin(filename) \ 70 | if (!cimg::strncasecmp(cimg::split_filename(filename),"foo",3)) return load_foo(filename); 71 | #endif 72 | #ifndef cimg_save_plugin 73 | #define cimg_save_plugin(filename) \ 74 | if (!cimg::strncasecmp(cimg::split_filename(filename),"foo",3)) return save_foo(filename); 75 | #endif 76 | 77 | // End of the plugin. 78 | //------------------- 79 | #endif /* cimg_plugin_addfileformat */ 80 | -------------------------------------------------------------------------------- /plugins/ipl_alt.h: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : ipl_alt.h 4 | # ( C++ header file - CImg plug-in ) 5 | # 6 | # Description : CImg plug-in providing the CImg->IPL and IPL->CImg 7 | # conversions for generic image types 8 | # ( IPL = Intel Performance Library ) 9 | # This file is a part of the CImg Library project. 10 | # ( http://cimg.eu ) 11 | # 12 | # Copyright : newleft (haibo.zheng@gmail.com) 13 | # newleftist@hotmail.com 14 | # 15 | # License : CeCILL v2.0 16 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 17 | # 18 | # This software is governed by the CeCILL license under French law and 19 | # abiding by the rules of distribution of free software. You can use, 20 | # modify and/ or redistribute the software under the terms of the CeCILL 21 | # license as circulated by CEA, CNRS and INRIA at the following URL 22 | # "http://www.cecill.info". 23 | # 24 | # As a counterpart to the access to the source code and rights to copy, 25 | # modify and redistribute granted by the license, users are provided only 26 | # with a limited warranty and the software's author, the holder of the 27 | # economic rights, and the successive licensors have only limited 28 | # liability. 29 | # 30 | # In this respect, the user's attention is drawn to the risks associated 31 | # with loading, using, modifying and/or developing or reproducing the 32 | # software by the user in light of its specific status of free software, 33 | # that may mean that it is complicated to manipulate, and that also 34 | # therefore means that it is reserved for developers and experienced 35 | # professionals having in-depth computer knowledge. Users are therefore 36 | # encouraged to load and test the software's suitability as regards their 37 | # requirements in conditions enabling the security of their systems and/or 38 | # data to be ensured and, more generally, to use and operate it in the 39 | # same conditions as regards security. 40 | # 41 | # The fact that you are presently reading this means that you have had 42 | # knowledge of the CeCILL license and that you accept its terms. 43 | # 44 | */ 45 | 46 | #ifndef cimg_plugin_IPL 47 | #define cimg_plugin_IPL 48 | 49 | // Conversion IPL -> CImg (constructor) 50 | CImg(const IplImage* src):_width(0),_height(0),_depth(0),_spectrum(0),_is_shared(false),_data(0) { 51 | assign(src); 52 | } 53 | 54 | // Conversion IPL -> CImg (in-place constructor) 55 | CImg& assign(const IplImage* src) { 56 | if (!src) return assign(); 57 | switch (src->depth) { 58 | case IPL_DEPTH_1U: { // 1-bit int. 59 | IplImage *src1 = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1); 60 | cvConvert(src,src1); 61 | CImg((unsigned char*)src1->imageData,src1->nChannels,src1->width,src1->height,1,true). 62 | get_permute_axes("yzcx").move_to(*this); 63 | cvReleaseImage(&src1); 64 | } break; 65 | case IPL_DEPTH_8U: // 8-bit unsigned int. 66 | CImg((unsigned char*)src->imageData,src->nChannels,src->width,src->height,1,true). 67 | get_permute_axes("yzcx").move_to(*this); 68 | break; 69 | case IPL_DEPTH_8S: // 8-bit signed int. 70 | CImg((char*)src->imageData,src->nChannels,src->width,src->height,1,true). 71 | get_permute_axes("yzcx").move_to(*this); 72 | break; 73 | case IPL_DEPTH_16U: // 16-bit unsigned int. 74 | CImg((unsigned short*)src->imageData,src->nChannels,src->width,src->height,1,true). 75 | get_permute_axes("yzcx").move_to(*this); 76 | break; 77 | case IPL_DEPTH_16S: // 16-bit signed int. 78 | CImg((short*)src->imageData,src->nChannels,src->width,src->height,1,true). 79 | get_permute_axes("yzcx").move_to(*this); 80 | break; 81 | case IPL_DEPTH_32S: // 32-bit signed int. 82 | CImg((int*)src->imageData,src->nChannels,src->width,src->height,1,true). 83 | get_permute_axes("yzcx").move_to(*this); 84 | break; 85 | case IPL_DEPTH_32F: // 32-bit float. 86 | CImg((float*)src->imageData,src->nChannels,src->width,src->height,1,true). 87 | get_permute_axes("yzcx").move_to(*this); 88 | break; 89 | case IPL_DEPTH_64F: // 64-bit double. 90 | CImg((double*)src->imageData,src->nChannels,src->width,src->height,1,true). 91 | get_permute_axes("yzcx").move_to(*this); 92 | break; 93 | default: 94 | throw CImgInstanceException("CImg<%s>::assign(const IplImage* img) : IplImage depth is invalid.", 95 | pixel_type()); 96 | break; 97 | } 98 | if (!std::strcmp(src->channelSeq,"BGR")) mirror('v'); 99 | else if (!std::strcmp(src->channelSeq,"BGRA")) get_shared_channels(0,2).mirror('v'); 100 | return *this; 101 | } 102 | 103 | // Conversion CImg -> IPL 104 | IplImage* get_IPL(const unsigned int z=0) const { 105 | if (is_empty()) 106 | throw CImgInstanceException("CImg<%s>::get_IPL() : instance image (%u,%u,%u,%u,%p) is empty.", 107 | pixel_type(),_width,_height,_depth,_spectrum,_data); 108 | if (z>=_depth) 109 | throw CImgInstanceException("CImg<%s>::get_IPL() : specified slice %u is out of image bounds (%u,%u,%u,%u,%p).", 110 | pixel_type(),z,_width,_height,_depth,_spectrum,_data); 111 | const CImg 112 | _slice = _depth>1?get_slice(z):CImg(), 113 | &slice = _depth>1?_slice:*this; 114 | CImg buf(slice); 115 | if (_spectrum==3 || _spectrum==4) buf.get_shared_channels(0,2).mirror('v'); 116 | buf.permute_axes("cxyz"); 117 | IplImage* const dst = cvCreateImage(cvSize(_width,_height),sizeof(T)*8,_spectrum); 118 | std::memcpy(dst->imageData,buf.data(),buf.size()*sizeof(T)); 119 | return dst; 120 | } 121 | 122 | #endif /* cimg_plugin_IPL */ 123 | -------------------------------------------------------------------------------- /plugins/tinymatwriter.h: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : tinymatwriter.h 4 | # ( C++ header file - CImg plug-in ) 5 | # 6 | # Description : This CImg plug-in provide functions to write image as 7 | # Matlab MAT files 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Jan W. Krieger 11 | # ( j.krieger(at)dkfz.de jan(at)jkrieger.de ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | /*----------------------------------------------------------------------------------- 45 | 46 | IMPORTANT NOTE : 47 | 48 | You *need* to compile tinymatwriter.cpp and link the result to your project and 49 | include "tinymatwriter.h" berfore inclusing CIMg or this plugin! 50 | 51 | This library is available from: 52 | https://github.com/jkriege2/TinyMAT 53 | ------------------------------------------------------------------------------------*/ 54 | 55 | 56 | 57 | #ifndef cimg_plugin_tinymatwriter 58 | #define cimg_plugin_tinymatwriter 59 | 60 | #include 61 | 62 | ///////////////////////////////////////////////////////////////// 63 | // 64 | // Define main CImg plugin functions. 65 | // (you should use these functions only in your own code) 66 | // 67 | ///////////////////////////////////////////////////////////////// 68 | 69 | //! Save image as a MAT file. 70 | /** 71 | \param filename filename of the output file 72 | \note TinyMATWriter supports signed/unsigned int with 8/16/32/64 bits, double, float and bool as pixel types! 73 | **/ 74 | const CImg& save_tinymat(const char *filename) const { 75 | 76 | TinyMATWriterFile* mat=TinyMATWriter_open(filename); 77 | if (mat) { 78 | int32_t size_x=width(); 79 | int32_t size_y=height(); 80 | int32_t size_z=depth(); 81 | int32_t size_c=spectrum(); 82 | 83 | int32_t sizes[4]={size_x, size_y, size_z, size_c}; 84 | uint32_t dims=4; 85 | if (size_c==1) { 86 | dims=3; 87 | if (size_z==1) { 88 | dims=2; 89 | if (size_y==1) { 90 | dims=1; 91 | } 92 | } 93 | } 94 | 95 | TinyMATWriter_writeMatrixND_rowmajor(mat, "CImg_image", data(), sizes, dims); 96 | TinyMATWriter_close(mat); 97 | } else { 98 | throw CImgIOException(_cimg_instance 99 | "save_tinymat(): Failed to open file.", 100 | cimg_instance); 101 | } 102 | 103 | return *this; 104 | } 105 | 106 | 107 | // End of the plug-in 108 | //------------------- 109 | #endif /* cimg_plugin_tinymatwriter */ 110 | -------------------------------------------------------------------------------- /plugins/vtk.h: -------------------------------------------------------------------------------- 1 | /* 2 | # 3 | # File : vtk.h 4 | # ( C++ header file - CImg plug-in ) 5 | # 6 | # Description : CImg plugin that implements a way to save 3d scene as TK legacy file format. 7 | # This file is a part of the CImg Library project. 8 | # ( http://cimg.eu ) 9 | # 10 | # Copyright : Haz-Edine Assemlal 11 | # ( http://www.cim.mcgill.ca/~assemlal/ ) 12 | # 13 | # License : CeCILL v2.0 14 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) 15 | # 16 | # This software is governed by the CeCILL license under French law and 17 | # abiding by the rules of distribution of free software. You can use, 18 | # modify and/ or redistribute the software under the terms of the CeCILL 19 | # license as circulated by CEA, CNRS and INRIA at the following URL 20 | # "http://www.cecill.info". 21 | # 22 | # As a counterpart to the access to the source code and rights to copy, 23 | # modify and redistribute granted by the license, users are provided only 24 | # with a limited warranty and the software's author, the holder of the 25 | # economic rights, and the successive licensors have only limited 26 | # liability. 27 | # 28 | # In this respect, the user's attention is drawn to the risks associated 29 | # with loading, using, modifying and/or developing or reproducing the 30 | # software by the user in light of its specific status of free software, 31 | # that may mean that it is complicated to manipulate, and that also 32 | # therefore means that it is reserved for developers and experienced 33 | # professionals having in-depth computer knowledge. Users are therefore 34 | # encouraged to load and test the software's suitability as regards their 35 | # requirements in conditions enabling the security of their systems and/or 36 | # data to be ensured and, more generally, to use and operate it in the 37 | # same conditions as regards security. 38 | # 39 | # The fact that you are presently reading this means that you have had 40 | # knowledge of the CeCILL license and that you accept its terms. 41 | # 42 | */ 43 | 44 | #ifndef cimg_plugin_vtk 45 | #define cimg_plugin_vtk 46 | 47 | // Save 3D scene in legacy VTK format 48 | /* *this: CImgList of points 49 | * faces: CImgList of faces 50 | * colors: CImgList of colors, 51 | * opacities: CImgList of opacities 52 | */ 53 | template 54 | CImgList& save_vtk(const char* const filename, 55 | const CImgList& faces, 56 | const CImgList& colors, 57 | const CImgList& opacities) { 58 | // Open file 59 | std::FILE *const nfile = cimg::fopen(filename,"w"); 60 | 61 | // Header 62 | std::fprintf(nfile,"# vtk DataFile Version 3.0\n"); 63 | std::fprintf(nfile,"%s\n",filename); 64 | std::fprintf(nfile,"ASCII\n"); 65 | std::fprintf(nfile,"DATASET UNSTRUCTURED_GRID\n"); 66 | 67 | // Points 68 | std::fprintf(nfile,"POINTS %u float\n",points.size()); 69 | cimglist_for(points,p) 70 | std::fprintf(nfile,"%f %f %f\n",points[p](0),points[p](1),points[p](2)); 71 | std::fprintf(nfile,"\n"); 72 | 73 | // Faces (valid only for triangles - type 5) 74 | if (faces) { 75 | std::fprintf(nfile,"CELLS %u %u\n",faces.size(),faces.size()*4); 76 | cimglist_for(faces,f) 77 | std::fprintf(nfile,"%d %u %u %u\n",3,faces[f](0),faces[f](1),faces[f](2)); 78 | std::fprintf(nfile,"CELL_TYPES %u\n",faces.size()); 79 | cimglist_for(faces,f) 80 | std::fprintf(nfile,"%d\n",5); 81 | std::fprintf(nfile,"\n"); 82 | } 83 | 84 | // Colors and Opacities 85 | std::fprintf(nfile,"CELL_DATA %d\n",colors.size()); 86 | std::fprintf(nfile,"COLOR_SCALARS colors 4\n"); 87 | 88 | const tc tcmax = cimg::type::max(); 89 | cimglist_for(colors,t) 90 | std::fprintf(nfile,"%f %f %f %f\n", 91 | (float)colors[t](0)/tcmax, 92 | (float)colors[t](1)/tcmax, 93 | (float)colors[t](2)/tcmax, 94 | opacities[t](0)); 95 | std::fprintf(nfile,"\n"); 96 | 97 | // Close file 98 | cimg::fclose(nfile); 99 | 100 | return *this; 101 | } 102 | 103 | #endif /* cimg_plugin_vtk */ 104 | -------------------------------------------------------------------------------- /resources/CImg.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr 2 | exec_prefix=/usr 3 | includedir=/usr/include/CImg 4 | 5 | Name: CImg 6 | Description: C++ Template Image Processing Toolkit 7 | Version: 1.5.0 8 | Cflags: -I${includedir} 9 | -------------------------------------------------------------------------------- /resources/cimg_ftp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env gmic 2 | 3 | skip "${1=}" 4 | 5 | # Retrieve relative path 6 | x "pwd >/tmp/pwd.txt" 7 | it /tmp/pwd.txt autocrop 10 8 | pwd={`" 9 | path = crop(); 10 | base = 'CImg/html'; 11 | p = find(path,base); 12 | p>0?( 13 | l = size(path) - p - size(base); 14 | copy(path,path[p + size(base)],l); 15 | path[l] = _'/'; path[l+1] = 0):(path[0] = 0); 16 | path"`} 17 | is_pwd={['$pwd']!=0} 18 | 19 | # Upload file or directory. 20 | if "s = ['$1']; "$is_pwd" && (s==0 || s=='.')" # Synchronize current directory 21 | e[] "Synchronize current directory '"${pwd}"' with 'SERVER"${pwd}"'.\n" 22 | com="lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL . /home/"$GMIC_LOGIN"/www/CImg"${pwd}" ; quit\"" 23 | x $com 24 | 25 | elif $is_pwd" && isdir(['"$1"'])" # Synchronize specified directory 26 | e[] "Synchronize directory '$1' with 'SERVER"${pwd}"$1'.\n" 27 | com="lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL \\\"$1\\\" \\\"/home/"$GMIC_LOGIN"/www/CImg"${pwd}"$1\\\" ; quit\"" 28 | x $com 29 | 30 | elif isfile(['"$1"']) # Upload single file 31 | if !$is_pwd pwd="/" fi 32 | e[] "Upload file '$1' to 'SERVER"${pwd}"'.\n" 33 | com="lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O \\\"/home/"$GMIC_LOGIN"/www/CImg"${pwd}"\\\" \\\"$1\\\"; quit\"" 34 | x $com 35 | 36 | fi 37 | rm 38 | 39 | # Local Variables: 40 | # mode: sh 41 | # End: 42 | # 43 | # (End of G'MIC custom commands) 44 | -------------------------------------------------------------------------------- /resources/compile_win_icl.bat: -------------------------------------------------------------------------------- 1 | REM ---------------------------------------------------------------- 2 | REM 3 | REM Script to compile CImg examples, using Intel ICL C++ Compiler. 4 | REM 5 | REM Copy this script into 'CImg/examples/' and run it to compile 6 | REM all examples. 7 | REM 8 | REM ---------------------------------------------------------------- 9 | 10 | CD ..\examples\ 11 | SET CPPFILE=CImg_demo captcha curve_editor2d dtmri_view3d edge_explorer2d fade_images gaussian_fit1d generate_loop_macros hough_transform2d image2ascii image_registration2d image_surface3d jawbreaker mcf_levelsets2d mcf_levelsets3d odykill pde_heatflow2d pde_TschumperleDeriche2d plotter1d radon_transform2d scene3d spherical_function3d tetris tron tutorial wavelet_atrous use_chlpca use_draw_gradient use_nlmeans use_RGBclass use_skeleton 12 | 13 | FOR %%F IN (%CPPFILE%) DO ( 14 | icl /I.. /GX /Ox %%F.cpp gdi32.lib user32.lib 15 | ) 16 | -------------------------------------------------------------------------------- /resources/compile_win_visualcpp.bat: -------------------------------------------------------------------------------- 1 | REM ---------------------------------------------------------------- 2 | REM 3 | REM Script to compile CImg examples, using Microsoft Visual C++. 4 | REM 5 | REM Copy this script into 'CImg/examples/' and run it to compile 6 | REM all examples. 7 | REM 8 | REM ---------------------------------------------------------------- 9 | 10 | CD ..\examples\ 11 | SET CPPFILE=CImg_demo captcha curve_editor2d dtmri_view3d edge_explorer2d fade_images gaussian_fit1d generate_loop_macros hough_transform2d image2ascii image_registration2d image_surface3d jawbreaker mcf_levelsets2d mcf_levelsets3d odykill pde_heatflow2d pde_TschumperleDeriche2d plotter1d radon_transform2d scene3d spherical_function3d tetris tron tutorial wavelet_atrous use_chlpca use_draw_gradient use_nlmeans use_RGBclass use_skeleton 12 | FOR %%F IN (%CPPFILE%) DO ( 13 | cl /W4 /wd"4127" /wd"4311" /wd"4312" /wd"4512" /wd"4571" /wd"4640" /wd"4706" /wd"4710" /wd"4800" /wd"4804" /wd"4820" /wd"4996" /c /EHsc /D "_CRT_SECURE_NO_WARNINGS" /I"%SDKPATH%\Include" /I"..\\" %%F.cpp 14 | link /LIBPATH:"%SDKPATH%\Lib" %%F.obj user32.lib gdi32.lib shell32.lib 15 | ) 16 | -------------------------------------------------------------------------------- /resources/debian/changelog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/resources/debian/changelog -------------------------------------------------------------------------------- /resources/debian/cimg-dev.dirs: -------------------------------------------------------------------------------- 1 | usr/include/CImg 2 | usr/include 3 | usr/share/CImg 4 | -------------------------------------------------------------------------------- /resources/debian/cimg-dev.install: -------------------------------------------------------------------------------- 1 | CImg.h resources html examples plugins CHANGES.txt README.txt usr/share/CImg 2 | CImg.h plugins usr/include/CImg 3 | README.txt usr/share/doc/cimg-dev 4 | -------------------------------------------------------------------------------- /resources/debian/cimg-dev.links: -------------------------------------------------------------------------------- 1 | usr/include/CImg/CImg.h usr/include/CImg.h 2 | usr/share/CImg/html usr/share/doc/cimg-dev/html 3 | 4 | -------------------------------------------------------------------------------- /resources/debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /resources/debian/control: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/resources/debian/control -------------------------------------------------------------------------------- /resources/debian/copyright: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/resources/debian/copyright -------------------------------------------------------------------------------- /resources/debian/docs: -------------------------------------------------------------------------------- 1 | changelog 2 | -------------------------------------------------------------------------------- /resources/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # GNU copyright 1997 to 1999 by Joey Hess. 5 | # 6 | # Modified to make a template file for a multi-binary package with separated 7 | # build-arch and build-indep targets by Bill Allombert 2001 8 | # 9 | # Modified in order to update the package by François-Xavier Dupé 2007 10 | 11 | # Uncomment this to turn on verbose mode. 12 | #export DH_VERBOSE=1 13 | 14 | # This has to be exported to make some magic below work. 15 | export DH_OPTIONS 16 | 17 | CFLAGS = -Wall -g 18 | 19 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 20 | CFLAGS += -O0 21 | else 22 | CFLAGS += -O3 23 | endif 24 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 25 | INSTALL_PROGRAM += -s 26 | endif 27 | 28 | build: build-indep-stamp 29 | build-indep-stamp: 30 | #cd examples && $(MAKE) "LDFLAGS=-lm -lpthread" 31 | #cd examples && $(MAKE) clean 32 | #$(MAKE) doc 33 | touch build-indep-stamp 34 | 35 | clean: 36 | dh_testdir 37 | dh_testroot 38 | rm -f build-arch-stamp build-indep-stamp 39 | dh_clean 40 | 41 | install: 42 | dh_testdir 43 | dh_testroot 44 | dh_clean -k 45 | dh_installdirs 46 | dh_install 47 | 48 | binary-indep: build install 49 | dh_testdir 50 | dh_testroot 51 | dh_installchangelogs 52 | dh_installdocs 53 | dh_compress 54 | # dh_installmenu 55 | # dh_installdebconf 56 | # dh_installlogrotate 57 | # dh_installemacsen 58 | # dh_installpam 59 | # dh_installmime 60 | # dh_installinit 61 | # dh_installcron 62 | # dh_installinfo 63 | # dh_installman 64 | dh_link 65 | dh_strip 66 | dh_fixperms 67 | # dh_perl 68 | # dh_python 69 | dh_makeshlibs 70 | dh_installdeb 71 | dh_shlibdeps 72 | dh_gencontrol 73 | dh_md5sums 74 | dh_builddeb 75 | 76 | # Build architecture dependant packages using the common target. 77 | binary-arch: build install 78 | 79 | binary: binary-indep binary-arch 80 | .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch 81 | -------------------------------------------------------------------------------- /resources/project_win_visualcpp/project_win_visualcpp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "project_win_visualcpp", "project_win_visualcpp.vcproj", "{9A50ACD6-B1AB-4AAF-A85C-D5E388EF024B}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {9A50ACD6-B1AB-4AAF-A85C-D5E388EF024B}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {9A50ACD6-B1AB-4AAF-A85C-D5E388EF024B}.Debug|Win32.Build.0 = Debug|Win32 14 | {9A50ACD6-B1AB-4AAF-A85C-D5E388EF024B}.Release|Win32.ActiveCfg = Release|Win32 15 | {9A50ACD6-B1AB-4AAF-A85C-D5E388EF024B}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /resources/project_win_visualcpp/project_win_visualcpp.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/resources/project_win_visualcpp/project_win_visualcpp.suo -------------------------------------------------------------------------------- /resources/project_win_visualcpp/project_win_visualcpp.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreycLab/CImg/add2c47fb53ebed2ceaea628cc996c4f474cc282/resources/project_win_visualcpp/project_win_visualcpp.vcproj -------------------------------------------------------------------------------- /resources/pycimg.py: -------------------------------------------------------------------------------- 1 | # 2 | # File : pycimg.py 3 | # ( Python file ) 4 | # 5 | # Description : Show how to import .cimg and .cimgz files into python (numpy). 6 | # This file is a part of the CImg Library project. 7 | # ( http://cimg.eu ) 8 | # 9 | # Copyright : Antonio Albiol, Universidad Politecnica Valencia (SPAIN) 10 | # 11 | # In case of issues or comments contact Antonio Albiol at: 12 | # aalbiol (at) dcom.upv.es 13 | # 14 | # Licenses : This file is 'dual-licensed', you have to choose one 15 | # of the two licenses below to apply. 16 | # 17 | # CeCILL-C 18 | # The CeCILL-C license is close to the GNU LGPL. 19 | # ( http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html ) 20 | # 21 | # or CeCILL v2.1 22 | # The CeCILL license is compatible with the GNU GPL. 23 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html ) 24 | # 25 | # This software is governed either by the CeCILL or the CeCILL-C license 26 | # under French law and abiding by the rules of distribution of free software. 27 | # You can use, modify and or redistribute the software under the terms of 28 | # the CeCILL or CeCILL-C licenses as circulated by CEA, CNRS and INRIA 29 | # at the following URL: "http://www.cecill.info". 30 | # 31 | # As a counterpart to the access to the source code and rights to copy, 32 | # modify and redistribute granted by the license, users are provided only 33 | # with a limited warranty and the software's author, the holder of the 34 | # economic rights, and the successive licensors have only limited 35 | # liability. 36 | # 37 | # In this respect, the user's attention is drawn to the risks associated 38 | # with loading, using, modifying and/or developing or reproducing the 39 | # software by the user in light of its specific status of free software, 40 | # that may mean that it is complicated to manipulate, and that also 41 | # therefore means that it is reserved for developers and experienced 42 | # professionals having in-depth computer knowledge. Users are therefore 43 | # encouraged to load and test the software's suitability as regards their 44 | # requirements in conditions enabling the security of their systems and/or 45 | # data to be ensured and, more generally, to use and operate it in the 46 | # same conditions as regards security. 47 | # 48 | # The fact that you are presently reading this means that you have had 49 | # knowledge of the CeCILL and CeCILL-C licenses and that you accept its terms. 50 | # 51 | 52 | import numpy as np 53 | import zlib 54 | import os 55 | 56 | typesDict={'float':'float32' ,'double':'float64', 57 | 'unsigned_short':'uint16','unsigned_char':'uint8', 58 | 'int':'int32', 'short':'int16'} 59 | 60 | def cimgread( filename ): 61 | """ USAGE: a= cimgread(filename) 62 | For CImg Images: 63 | * returns a npy array in the case of cimg 64 | * Supports compression 65 | * It squeezes singleton dimensions. If a CImg image has dimensions (w,h,1,c) 66 | the returned python object will have shape 67 | a.shape --> (h,w,c) 68 | * a(y,x,z,c) to access one element 69 | For CImgList: 70 | * returns a list of npy arrays 71 | * if original CImgList has nimages, then 72 | len(a) --> nimages 73 | * To access one pixel of the j-th image use a[j](y,x,z,c) 74 | 75 | """ 76 | 77 | basename, file_extension = os.path.splitext(filename) 78 | fa = open(filename, 'rb') 79 | 80 | out =[] 81 | line0 = fa.readline() #Endiannes 82 | tiposdato=line0.split() 83 | number_of_images=int(tiposdato[0]) 84 | datatypecimg=tiposdato[1].decode() 85 | endiannes = tiposdato[2] 86 | 87 | datatype = typesDict[datatypecimg]; 88 | 89 | for n in range(number_of_images): 90 | line1 = fa.readline() # Dimensions 91 | dimensiones = line1.split() 92 | width = int(dimensiones[0]); 93 | height = int(dimensiones[1]); 94 | depth = int(dimensiones[2]); 95 | spectrum = int(dimensiones[3]); 96 | 97 | if file_extension == '.cimgz': 98 | csize= int(dimensiones[4].decode()[1:]) 99 | data = fa.read(csize) 100 | data = zlib.decompress(data) 101 | else: 102 | data = fa.read(width*height*depth*spectrum*dtype(datatype).itemsize) 103 | 104 | flattened = np.frombuffer(data,dtype=datatype) 105 | 106 | cimg=flattened.reshape((spectrum,depth,height,width)) 107 | cimg=np.squeeze(np.transpose(cimg,(2,3,1,0))) 108 | out.append(cimg) 109 | 110 | fa.close() 111 | if len(out)==1: 112 | return out[0] 113 | return out 114 | --------------------------------------------------------------------------------