I have geo-referenced several scanned maps. Theses are placed side by side on separate layers in QGIS. They overlay other older maps of the same areas. Georeferencing caused the maps to have black borders. How can I change these black borders to transparent, or eliminate them, so that the underlying maps' data shows through the gaps in detail between the maps? Here is a screen shot:
Go to Layer Properties. In the Transparency tab, set the transparency of your borders to 0, which should make the border transparent. You can either add values manually (type them in) or add values from the map using the color picker (click on black border of your raster). As @Zoltan notes, however, this may cause some loss of black pixels in your raster. For future georeferencing, you can do as Zoltan suggests and use 0 for transparency.
Are these tif files? What version of QGIS are you using?
Thanks to all for advice. I have now found a simple workaround for this problem that will eliminate the black borders between adjacent maps and restore the detail lost in the black borders: Make georeferenced rasters as usual, but leave the "Transparency/"No Data Value" box "checked". This will leave lots of drop out in the map detail. Then create a duplicate layer, but this time "uncheck" the "No Data Value Box". Do this for all the adjacent map layers. Group the Unchecked layers together below the grouped checked layers. The Unchecked layers will fill in the missing drop out data from the checked layers and the Checked layers will prevent the black borders from showing through. There is no apparent loss of quality in the finished result.
There are three options :
- The first one is create a mask then use it in gdalwarp to cut it or add an alpha mask to your raster
- The third one is far more complicated. It consists in updating the raster border values to a certains value X the use this value as a nodata value with gdal utilities.
Are these GeoTIFFs or normal tiffs with a .tfw file? I usually use GIMP to do extensive editing on images after georeferencing them. This works no problem if you:
- have a world file (.tfw)... I'm not sure if GIMP will retain the geotiff header information when you export the edited image.
- DO NOT crop the image... the .tfw file needs the size/extent of the image to remain the same to retain the correct georeferencing information.
But if those two things are under control, using GIMP to edit scanned and georeferenced maps is exceptionally useful.
Go to Properties on the raster image; go to the transparency tab; where it says "Transparency band" add bands red, green, and blue with a 100% transparency on them and then click apply.