<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Hello Forum,<br></div><div dir="ltr"><div dir="ltr"><div><br></div><div>I am trying to merge a few tiff images (each has 4 bands) in R and It was partly successful.</div><div><br></div><div>However a look (in QGIS) at the merged output revealed some sort of radiometric distortions in the output file.</div><div><br></div><div>The output/merged file has significant brightness in many portions of the image.</div><div><br></div><div>I would appreciate help in this regard.</div><div><br></div><div>Please find below my source code in R.</div><div><br></div><div>I sent this request on 11/01/2019, perhaps the images i attached did not allow for its approval to the forum.</div><div><br></div><div>I think images exceeded the accepted size for posting to the Forum, hence, my not attaching it in this email.</div><div><br></div><div>Thank You.</div><div><br></div><div>Adebola Hassan</div><div><br></div><div>#Rcode</div><div><div>#list all tif files in working directory</div><div>all_tiff_list = list.files(".", pattern = "tif", full.names = T)</div><div><br></div><div>#plot first img only</div><div>all_tiff_imgs1 = stack(all_tiff_list[1])</div><div>plot(all_tiff_imgs1)</div><div><br></div><div>#merge and plot first and second tiff file</div><div>all_tiff_imgs2 = stack(all_tiff_list[2])</div><div>tiff_merge_1_2 = merge(all_tiff_imgs1, all_tiff_imgs2)</div><div>plot(tiff_merge_1_2)</div><div><br></div><div>#merge and plot all tiff files</div><div>img_list = list()</div><div>for (i in 1:length(all_tiff_list)) {</div><div>  img_list[i] = stack(all_tiff_list[i])</div><div>}</div><div><br></div><div>img_list$filename <- 'test.tif'</div><div>img_list$overwrite <- T</div><div>all_img_merge = do.call(merge, img_list)</div><div>plot(all_img_merge)</div><div>ggRGB(all_img_merge, r = 1, g = 2, b = 3)</div></div><div><br></div></div></div>
</div></div>