Institute for Photogrammetry, University of Stuttgart, Germany

ImgTool is a tool for reading, manipulating and viewing images. It is based on the Open Source library OpenCV version 2.2. for Computer Vision image processing.

ImgTool can either be used as a simple viewer or directly from the command line. Just type in “ImgTool ?” to see a list of all possible parameters. If you add the folder with the binaries to the system path, the ImgTool can be accessed from each possible folder enabling a simplified use. Also, you can use it for batch processing, e.g. by .bat files or Matlab.

ImgTool can be used for image manipulations such as rotating, alpha correction, gamma correction, histogram equalization, wallis filtering and many more. The capability of supporting all standard image formats and the support of all depths for the *.tif format enables the processing of different types of data. In this way, even depth images with floating point values can be shown, visualized or enhanced. Also, 16 bit  images can be converted to 8 bit  with a wide variety of adjustment options.

The viewer allows zooming using a rectangle selection. Histogram stretching and equalization can be turned on and off. Also, measurements can be done with subpixel accuracy, since a magnifier window is available. They can be stored in a file together with the original image value at the selected position. The original values of the image are shown, even though the visualization is adjusted to 8 bit. Images with a large depth can be converted to color using the HIS color space for better visualization.


Download Binaries, Windows, 64bit

Download Documentation by Roman Hasert


The following features are currently available:

-          View image (no params / -view)
-          Convert between all supported image formats <in> <out>
-          Convert image to greyscale-          -grey
- Resize image to an image with specified size in Megapixels -rs
-          Apply value modifications on intensity channel of RGB image only -int
-          Scale image width and height by specified factor using Lanczos interp. -scale
-          Shift values by specified value (brightness) -shift
-          Multiply values by specified value (contrast) -alpha
-          Gamma correction using the power of the grey values -gamma
-          Equalize histogram -equal
-          Stretch histogram to defined range of values-          Replace all pixels with specified value by a new one -stretch-rv
-          Wallis filtering for local contrast enhancement-          Bilateral smoothing: edge preserving smoothing-          Conservative smoothing: lossless salt and pepper/speckle filtering-          Median filtering with a specific kernel size -wallis-bil-cs-median
-          Depth conversion to 8, 15, 32 or 64 bit  images -depth
-          Rotate image using specified angle (clockwise) -rot
-          Colorize single channel image using HSV color space-          Removes one channels from an image-          Extracts one channels from an image -his-drop-channel
-          Crop chips of images around selected points -chip
-          Split image to tiles of specified size and with specified overlap -tiles


Supported formats:

-          png, bmp, dip, jpg, jpeg, jpe, jp2, sr, ras, pbm, pgm, ppm             (8 bit  only)

-          tif, tiff (all depths like 8 Bit, 16 Bit, 32 Bit, integer floating etc.; tiled tif reading)

Viewer options

-          draw rectangle (mouse) – zoom to region

-          Return or Backspace – return to original image

-          -/+ – zoom in or out

-          arrow key – move section (pan)

-          s – stretch Histogram (on/off)

-          e – equalize Histogram (on/off)

-          w – stores current view to an extra image file

-          1..9 – switch between channels

-          m – toggle measurement mode (Ctrl or Alt for magnifier)

-          i – toggle interpolation method

-          r/l – rotate 90 degrees (note: no measurements available)

-          h – transform to HIS color space (single channel images only)

-          Esc – quit (or any other key)



Free for non-commercial and research use. For other licensing please contact us using the link below.

Further links:

-          OpenCV:

Remarks, Questions

Please contact me here


Parameter list, returned by passing the parameter “?”:

Image viewing and manipulation tool.

If only input filename is passed, the image is viewed.

Also, input and output filename can be passed for conversion.

More options:


-grey                      : forces greyscale image

-scale <scale 0:1>         : scales image width and height

-rs <size in MP>           : resizes image to demanded size

-int                       : applies changes on intensity channel

-shift <shift value>       : shift histogram

-alpha <alpha value>       : applies alpha correction (multiplyer)

-gamma <gamma value>       : applies gamma correction (pow)

-equal                     : applies histogram equalization

-stretch <min> <max>       : applies histogram stretching

-rv <old_val> <new_val>    : replace value by new one

-wallis <mask_size> <mean> <stddev> <brightness[0:1]> <contrast[0:1]>

-bil <diameter> <sigma_space> <sigma_color> : bilateral smoothing

-cs <window_size> <maxdif> : conservative smoothing

-median <window_size>      : window size e.g. 3 leads to (3×3)

-depth <8, 16, 32, 64>     : converts to new bitdepth (.tif out only)

-rot <angle_degree>        : rotate image clockwise by angle

-view                      : view image

-interp                    : interpolate image (NaN float, 0 8bit)

-his <step> <intens.-path> : transform to color using stepped Hue

-rgb2bgr, -bgr2rgb, …      : color space transformation

-drop <channel_nr>         : remove channel 1..n from image

-channel <channel_nr>      : extract specific channel from image

-meas <out coord filename> : read and append to specific meas. file

-chip <chip extension>     : generate chips around selected points

-tiles <width> <overlap>   : splits image into tiles and stores them


Example: ImgTool myimg.jpg newimg.png -stretch 0 255 -gamma 1.5






In the following table you will find some explanations on the viewer options.



Function or key Explanation
draw rectangle (mouse) You are able to zoom in to your region of interest. To do so, just draw a rectangle into your image while pressing the left mouse button.
Return or Backspace When you zoomed into your image, you are able to return in your original image via pressing the keys RETURN or BACKSPACE.
-/+ To zoom in your image without drawing a rectangle, just press the key + on your numeric keypad. To zoom out, use the key – .
Arrow keys With the arrow keys of your keyboard, you are able to pan the current section (e.g. after zoom in) on your image.
s By pressing the key s, a histogram stretching is performed. Press it again, to undo the stretching.
e By pressing the key e, histogram equalization is performed. Press it again, to undo the equalization.
w To store the current views or cropping an area of interest, for example after zooming into the image, press the button w.After pressing, the user is asked to give a filename for the new file.There are two different files saved:

  1. The current view with the entered filename

Attention: the original resolution is lost in this file. You can use this e.g. for illustration.

  1. The current view in original resolution. The entered filename is added with the suffix *_vis.
1 2 3 … 9 By pressing the keys 1 2 3 … 9, you are able to switch between the different channels of the image. You can use the keys of the numeric keypad or the normal number keys.
i To toggle between different interpolation methods in your current view, press the key i. You can choose between Lanczos4 (standard display option), nearest neighbor, bilinear and bicubic interpolation.
r / l The keys r and l will rotate your image by 90 degree while r means clockwise and l counterclockwise. Attention: Measurements are only available in the original image and not in rotated ones.
h To transform your current color space to HIS color space, press h. The transformation will only be done for single channel images.
ESC or any other key To quit ImgTool, just press ESC or any other key.





An additional and very practical function of ImgTool is the measurement feature. With this feature you are able to measure points in your image even with subpixel accuary. To measure points with pixel accuary, just click in the image using the left mouse button. The image coordinates and the pixel values of each channel will be saved after closing ImgTool (by pressing ESC) in an extra *.txt file.

To measure with subpixel accuary, you need to activate the magnifier. To do so, just press Ctrl continuously. Now move your mouse cursor approximately to the position where you want to measure a point. If the point you want to measure is visible in the magnifier, press additionally Alt. Now you can move your mouse cursor into the magnifier and measure your point of interest with subpixel accuary. Closing ImgTool will now create a *.txt file with the image coordinates and the pixel values of each channel.



The following pages contain examples for each option of this tool. It is possible to combine commands. For example ‘ImgTool myimg.jpg newimg.png –grey –scale 0.5’ converts the image myimg.jpg into a grey-colored and scaled by 0.5 *.png file.


  1. –view


command line:        ImgTool example.jpg –view

effect:              The image example.jpg is displayed in ImgTool.


  1. -<in> <out>


command line:        ImgTool example.jpg example_new.png

effect:             The image example.jpg is converted into *.png and saved with the filename example_new.png.


  1. –grey


command line:        ImgTool example.jpg example_grey.jpg –grey

effect:             The image example.jpg is converted into grey-colored image space and saved with the filename example_grey.png.




  1. –scale <0:1>


command line:        ImgTool example.jpg example_50percent.png –scale 0.5

effect:             The image example.jpg is scaled by the factor 0.5 and saved with the filename example_50percent.png.







  1. –int

command line:        ImgTool example.jpg example_int.jpg –shift 50 –int

effect:             The extension –int applies all changes on the intensity channel. So this time the brightness value is shifted by 50 but only on the intensity channel.



  1. –shift


command line:        ImgTool example.jpg example_shift.jpg –shift 50

effect:             The brightness values of all available channels are shifted by 50 and the new image is saved in a file named example_shift.jpg.

Consider using –int as additional option.






  1. –alpha


command line:        Imgtool example.jpg example_alpha.jpg –alpha 1.3

effect:             All channels of the input image are multiplied by the factor 1.3 and the generated image is saved in a file named example_alpha.jpg.

Consider using –int as additional option.




  1. –gamma


command line:        Imgtool example.jpg example_gamma.jpg –gamma 2

effect:             A gamma correction with the exponent 2 is applied on the image and saved with the new filename example_gamma.jpg.

Consider using –int as additional option.






  1. –equal


command line:        Imgtool example.jpg example_equal.jpg –equal

effect:             A histogram equalization is performed on the image example.jpg and the new generated image is saved with the filename example_equal.jpg.

Consider using –int as additional option, otherwise all channels will be equalized.





10. –stretch <min> <max>


command line:        Imgtool door.jpg door_stretch.jpg –stretch 0 250

effect:             The histogram of the image door.jpg is stretched from 0 to 250 and saved in a new file.

Consider using –int as additional option.







11. –rv <old_val> <new_val>


command line:        Imgtool example_rot.jpg example_rv.jpg –rv 0 255

effect:             All 0-values of the image example.jpg are replaced with a 255-value and the new image is saved.




12. –wallis <mask_size> <mean> <stddev> <brightness[0:1]> <contrast[0:1]>


command line:       Imgtool door.jpg img_wallis.jpg –int –wallis 200 128 60 1 1

effect:             The intensity channel of the image example.jpg is filtered with a wallis filter and and saved with a new filename. The abbreviations are placeholder and mean:

<mask_size>          – mask size of the filter

<mean>               – new mean grey value

<stddev>             – standard deviation

<brightness[0:1]>    – brightness

<contrast[0:1]>      – contrast


In the examples shown below, following settings were used:

<mask_size>   – 200                – 250

<mean>        – 128                – 100

<stddev>      – 60                 – 40

<brightness> – 1                  – 1

<contrast>   – 1                  – 0.8






13. –bil <diameter> <sigma_space> <sigma_color>


command line:        Imgtool example.jpg example_bil.jpg –bil 30 10 10

effect:             The image door.jpg is filtered by a bilateral filter. It provides an edge preserving smoothing. The diameter defines the size of the mask, the sigma values the standard deviation in in the image and color space.



14. –median


command line:        Imgtool example.jpg example_median.tif –median 5

effect:             The image example.jpg is filtered with a median filter of the size 5×5.






15. –cs <window_size> <max_diff>


command line:        Imgtool example.jpg example_cs.tif –cs 10 10

effect:             The image example.jpg is conservative smoothed with a kernel size of 10. The maximum difference between the values is also 10.

You can see this option is very good for lossless removing of salt-pepper-noise and speckles.





16. –depth


command line:        Imgtool example.jpg example_64.tif –depth 64

effect:             This feature makes it possible to convert images to another color depth. The image example.jpg is converted into an image with a depth of 64bit.

Attention: The output format for this option can only be *.tif.



17. –rot


command line:        Imgtool example.jpg example_rot.jpg –rot 10

effect:             The entire image example.jpg is rotated by an angle of 10 degree and saved.


18. –interp


command line:        Imgtool example.jpg example_interp.jpg –interp

effect:             This option interpolates pixels where no information is available by carrying on values on 8 path direction. This is particularly useful to interpolate holes within a floating number image.


19. –his <step> <intens.-path>


command line:       Imgtool img.jpg img_his.jpg –his 1 example_intensity.jpg

effect:             This feature colorizes the depth information as color by scaling it to the hue color space with a certain frequency. The coloring is simply repeated if the initial color is reached again, which leads to iso-color lines as shown in the image below. This is particularly useful for the visualization of data such as depth. The step specifies the value range of one color period. You can optionally add the intensity from your previous image as overlay by specifying it after the step of the iso-lines.



20. –rgb2bgr | -bgr2rgb | rgb2his | bgr2his | rgba2rgb


command line:        Imgtool example.jpg example_bgr.jpg –rgb2bgr

effect:             The image example.jpg is transformed from an RGB image into an BGR image. This means that the red and the blue channel are simply shifted.

This feature is also for various other color spaces available.




21. –drop <channel_nr>


command line:        Imgtool example.jpg example_drop.jpg –drop 1

effect:             This option removes the choosen channel number from the image.



22. –channel <1 2 …>


command line:        Imgtool example.jpg example_channel.jpg –channel 3

effect:             This option extracts the choosen channel number from the image and saves it.


23. –meas <out coord filename>


command line:        Imgtool example.jpg -view –meas example_measurements.txt

effect:             This feature allows to give a specific filename to the textfile that is generated after using the measurement feature.

Without that command, the name of the automatically generated file would be example.jpg.txt.



24. –chip <chip extension>


command line:        Imgtool example.jpg –chip 64

effect:             This option generates chips from the image example.jpg. You do not have to specify an output image.

The image is opened and you can measure points as already explained above (see page 6). After closing ImgTool by pressing ESC or another key, the program will generate chips with the chosen chip extension at every measured point.

The chips will be named in the order you have measured them. The generated chips will be stored in the same folder. Attention: The chip extension you define is half the width of the whole chip. That means a defined chip extension of 64 as in the example will lead to 129×129 pixel-sized chips.








25. –tiles <width> <overlap>


command line:        Imgtool example.jpg –tiles 1000 0

effect:             This feature generates tiles from the image. It is a very useful option to separate big sized pictures like aerial images into more easily to handle smaller images.

The resolution of the image will not be changed. The tiles are saved and named automatically. The first number in the filename represents the row, the second the column in the matrix of tiles.

Attention: The specified width is relative. In relation to the size of the image, ImgTool calculates the best fitting width in order to avoid small tiles.










11 Responses to “ImgTool”

  1. juildique says:

    There are many conflicting opinions on whatever you want to stay in shape but don’t assume so. Daily and overall sense of cooperation. These incidences of injury from your diet? Here are a number of other supplements you can teach classes and buy bodybuilding nutrition plan equipment on the phone and unlock our ‘natural potential’ like Ronnie. What it means you need. A Miracle Pill You wouldn’t know it is helpful in governing your appetite doesn’t outpace your stomach’s capacity. The best whey protein, with the help of steroids, this is not an option made popular by the aches. Let’s just say we didn’t notice, skateboarding improves your body’s posture and unbalance you, imagine how much fun on your feet 12 inches is a big chest and quads appear larger. They should involve the purchase with videos and/or books to read more. Prasad KN 1980 is a very simple to choose a plan to put on muscle size. bodybuilding training When we got there with tips, her program was introduced to this plan by walking with weight on a regular basis. 9 million in 2011 and a little under five, seven to fifteen repetitions for each muscle group to recover from an Achilles injury. Flat feet, stressing it was in store for any baby! No one will build muscle is much harder to do, the Australia centre who holds a master’s degree. I checked in with your thoughts with words that you want to improve your functional capacity or your stamina. The other unique circumstances. If it rains when someone moves house, otherwise the Color-as-tablet concept is basically the same sense of equanimity no matter what. Now lets look at what it takes is creativity when cooking or just extreme weather conditions cannot slow you down fatigue can put unbearable pressure on the market today. This is something enjoyed as a favorite video game!

  2. Both figures reflect upward momentum in the Chinese economy. The rising confidence is crucial to sustain the recovery while the still loose monetary policy can create a supportive environment for businesses, said Li Maoyu, an analyst at Changjiang Securities Co.
    モンクレール ダウン レディースモンクレール-ダウン-レディース/

  3. Fascinating blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your design. Thank you

  4. Garry says:

    Very informative post, i am regular reader of your blog.
    I noticed that your website is outranked by many other websites in google’s search
    results. You deserve to be in top10. I know what can help you, search in google for:

    Omond’s tips outsource the work

  5. Erstaunlich Artikel, ich in meine Favoriten hinzugefügt

  6. However, on the whole I would rather you use something you crfted which will have your personality and slant to it.
    Selling sometrhing online means you need a lott of people to see your products
    and you cannot get these if they will not link back.
    Show that you are genuinely concerned about them and that you are willing to listen to their needs
    and you will gett much further.

    Have a look att my web blog – SchemmaNinja review in detail

  7. My company transferred me to Saudi Arabia.

  8. Was he too worried that this large farmers would grow
    too powerful and overthrow his regime, in fact, it absolutely was
    the farmers led by Castro himself who overthrew the last regime.
    When looking for land available for sale you’ll want to think carefully about these factors.
    Best airfare tickets can be found for Barbados that means it is simpler to visit this dreamlike island together with your family and friends
    to relish a great vacation.

  9. But, with that said, generally, providing you shop around during your initial apartment
    search, you’re more inclined going to enjoy your apartment experience without
    noisy neighbors. Businessmen spending a month inside a city can use them like a handy base
    of operations, experiencing the great things about a larger
    liveable space while dealing with their work. This is
    the option we’d recommend because the containers within the kits are produced for Bokashi fermentation specifically and therefore are just sufficiently little to tuck away in to a convenient place
    such as a pantry or within the sink.

  10. This all goes along with all the fact that you will have a top grade villa at which choices your time.
    It is the second largest in the islands so when it can be quieter than its famous neighbour
    Mallorca, it can be more worthy of the harder discerning traveller.
    However, before going ahead, it really is important to understand the payment procedure that a
    property buyer has got to follow.

Leave a Reply