I have brought in multiple TIFF (raster) files into QGIS and want to combine them into one file. I tried this by going to Raster> Misc.> Merge. When doing this the output file comes out as gray and black and I want to keep the colors of my TIFF files.
2 Answers
You need to use Merge tool
from Processing toolbox -> GDAL/OGR -> Miscellaneous -> Merge
it has the option to Grab pseudocolor table from first layer
that you need to check, as you can see below:
Do not forget to choose a proper Output raster type
that match the raster type of the input data, or any type that is close to input raster data.
For example, I have two topographic map sheets with 8 bit unsigned integer
, but I don't have the same pixel type, so I chose UInt16
which is 16 bit unsigned integer
.
Input:
Here is the output after running the Merge tool:
-
Thank You, it worked. Now how can I, if possible, remove that black line in between the images I merge.– ShubCommented Jun 9, 2017 at 12:00
-
Also, with my TIFFs when I merge they change color to grayscale. Not sure why.– ShubCommented Jun 9, 2017 at 12:12
-
1@Jhunt9 make sure that pixel type in settings in the merge tool matches input raster pixel type. Commented Jun 9, 2017 at 14:08
-
How do I check what raster pixel type my inputs are? Are you talking about the output raster type? The one that defaults to Float32?– ShubCommented Jun 9, 2017 at 14:14
-
1Go to the right-click the raster layer in the table of content -> layer properties -> metadata and scroll down until you see pixel type and check what type from there. Commented Jun 9, 2017 at 14:54
Try the Clipper tool. Raster->Extraction->Clipper
Set the extent to cover the area you want to combine.
-
I can only select one input file when I do this and I want to select all of the files and combine them together.– ShubCommented Jun 8, 2017 at 19:28
-
1
gdal_merge.py
from the command line?