Quantum GIS Image Clipper Plugin

 Table of Contents

Basic Instructions

Exercise 1: Clip (Extract) a Portion of a Single Image

Exercise 2: Clip (Extract) Portions of Multiple Images

 Basic Instructions

        This plugin allows the QGIS user to save and combine parts of one or more images to a new image. This will appear to the user as if they are “clipping the images”.

 

The plugin is set up like any other QGIS Python plugin, just select Plugins > Manage Plugins from the menu and select the Image Clipper plugin.

1)    To begin, select an image from the list of active layers and press the Image Clipper button:

 

2)    Next verify the name of the output file (a default name and location is provided based upon the image selected in 1)

 

3)    Portions of images can be fused together by adding images to the list of images to be used, just click on the button “Select Output Files” and click on a new image layer and the image will be added to the list of images to be processed as shown in the next picture:

 

4)    Options for the No Data value (important for more than one image to be processed), for leaving the clip rectangle on the map after processing, for setting the line width and color of the clipping rectangle may be set prior to drawing the rectangle,

 

5)    Next the clipping rectangle is set up by clicking the “Set Clip Window” button and then by clicking the mouse on opposite corners of the image(s) to be clipped. The corners of the rectangle can be adjusted by more clicks of the mouse. Clicking outside of the bounds of the images will be ignored. The next picture shows a rectangle drawn over two images:

 

6)    Finally when the user is satisfied with the bounds of the clipping rectangle the output image can be created by clicking the button: “Clip the Image(s)”. A message containing information about the output image will be displayed before the dialog window is closed:

 

Exercise 1: Clip (Extract) a Portion of a Single Image

If you haven't already downloaded the test imagery and shape files then first download them from here:

 http://www.hwps.ca/QGISPythonPlugins/YawningstoneImagery.zip  and extract them to a local folder, preserving the folders in the data. Next open the project file MB-07007-81.qgs from this folder using a version of QGIS 1.1.0 or higher. You should see a view similar to this one below:

Next invoke the plugin by selecting the image layer and then by clicking on the button that is selected in the figure above. The Image Clipper options dialog window then appears. Change the output file name to 81-CLIPPED.tif and move the dialog out of the way of the image on the canvas, click the Set Clip Window button and click the cross-hairs cursor on opposite corners of the image. Further clicks inside of the image will adjust the corners of the clipping area, adjust the corners until the clipping (extract) area is totally within the area of the actual image. Note: mouse clicks outside of the image area will be ignored and have no effect on the position of the clipping rectangle.

 Finally click the Clip the image(s) button and a message box will appear displaying the information about the output image similar to the one shown in the figure below:

 

 

Exercise 2: Clip (Extract) Portions of Multiple Images

Next an exercise of combining and extracting (clipping) portions of four images will be done. First open the project yawningstoneFourImages.qgs from the same folder that was created in the beginning of Exercise 1.  You should see a view similar to this one below:

Now select the first image layer in the list and click the Image Clipper plugin button. Change the output file name to FourImagesCombined.tif and add the remaining three images attached to the project by clicking the Select More Image Files button and selecting the next layer in the list. Repeat this process until all of the image layers have been selected. When you press the drop-down list of images you should see all of the images as shown in the next picture:

Next click the Set Clip Window button and select a clip (extract) area encompassing the four images. Adjust the clip area by repeated mouse clicks on the map canvas. Next click the Clip the Image(s) button and a message box will appear similar to the one in the picture shown below: