Buy Now

Didger 3: Removing the Black Border After Warping an Image 

 

Introduction

A common use of Didger is to combine multiple image files by calibrating and warping them, exporting them as georeferenced TIFF files (GeoTIFFs), and mosaicking the GeoTIFFs together in a Didger vector project. The warping step expands the extents of the image slightly, which creates a black border. This border is usually undesirable when mosaicking the images, as it can obscure portions of any adjacent images.

Issue49Db1 (75K)

Warping an image creates a black border around it.
This border is undesirable when mosaicking two or more adjacent images.

There are two ways to remove the black border.

  1. During the warping step, specify a smaller range of Output Map Extents to prevent creation of the border.
  2. Let the border be created, but specify the black border color to be transparent when combining the images in the vector project.

This article provides detailed instructions on both methods. You can choose which is best suited to your needs.

Method 1: Setting the Output Map Extents

By default, the warp operation expands the extents of the map slightly, to provide room in case the image needs to be rotated. However, it is possible to reduce the extents so that the black border is not created. Perform the following steps:

  1. After the image is calibrated in a raster project, go to Image | Warp Image.
  2. In the Warp Image dialog, leave the Output Map Extents at the default values for now. Select the desired Warp Parameters and X and Y Output Bitmap Extents as appropriate, or leave them as defaulted, and click OK.
  3. You may get a message that says "The current bitmap is very large. Do you wish to add it to the undo list?" If so, click Yes. We will be undoing this warp operation in order to re-warp with different settings.
  4. After the warping calculations are completed, click OK in the Bitmap Import Options dialog. The warped image will appear with the black border around it.
  5. Make sure your display units are set to meters if the image is projected, lat/long if the image projection is set to Unprojected Lat/Long, or whatever calibration units were used if the image is in Cartesian coordinates. If you need to change the display units, go to Image | Calibrate Image, check or change the Display Units in the Initial Calibration Settings dialog (Step One), and then click Next, Next, Next, and Finish.
  6. Move the cursor to the X and Y minimum and maximum extents of the actual image (not including the black border), and write down the X and Y coordinates shown in the status bar.
     
    Recording new X/Y min/max values (75K)

    After warping the image, move the cursor to the extents of the image and
    write down the coordinates shown in the status bar.

  7. If you had to change the display units in step 5, go to Edit | Undo Calibration.
  8. Go to Edit | Undo New Bitmap to undo the warping.
  9. Go back to Image | Warp Image.
  10. This time, enter the X and Y min/max values that you recorded in step 6 in the Output Map Extents area. Make any desired changes to the Warp Parameters and X and Y Output Bitmap Extents and click OK.
  11. When the image is warped, the black border will be gone because of the reduced extents specified.
     
    Warped image without a black border (112K)

    After specifying the Output Map Extents in the Warp Image dialog box,
    warping the image does not create a black border.

  12. Export the image as a GeoTIFF. It will be ready to combine later with other images in a Didger vector project.

Method 2: Setting the Black Color to be Transparent

Once all the bitmaps have been georeferenced and warped in a raster project, export each of them to a GeoTIFF file. The GeoTIFF files will have the black borders around them. To mosaic them together and remove the black border, follow these steps:

  1. Go to File | New | Blank to create a blank Didger project.
  2. Go to File | Import Bitmap | Into Vector.
  3. Select one of the GeoTIFF files and click Open. In the Bitmap Import Options dialog, choose the Spatial Reference to use and click OK. The file is imported.
  4. Repeat steps 2 and 3 for each of the GeoTIFF files so they are all imported into one project. The images are aligned according to their calibration. Each image has the unwanted black border.
  5. To remove the black border, select one of the bitmaps and go to Image | Select Transparent Colors.
  6. The Select Transparent Colors dialog opens, and the cursor changes to a fat cross.
  7. Click anywhere on the black border of the image. Then click OK in the Select Transparent Colors dialog box. The black border becomes invisible.
  8. Repeat steps 5 through 7 for each of the images, making all the black borders transparent.
  9. If the images contain other black pixels, besides the ones in the border, they will also become transparent. To rectify this, draw a large polygon covering the interior of all images. Fill the polygon with solid black and use the Edit | Arrange | Move to Back command to move the polygon to the back of all the images. This will fill the areas that were unintentionalally made transparent.
  10. Now you can export the combined images as a single GeoTIFF file, digitize on top of it, or import other vector or data files.
Transparent borders (104K)

Set the black border to be transparent for each image and then draw a black polygon covering all the images and move it to the back.

If you have any questions about Didger or this article, please contact us at didgersupport@goldensoftware.com.


Back to Newsletter Index

 

Home * Products * Gallery * Support * About Us * Register * Order * Demos * Sitemap