<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">I currently have a RGB geotiff composite image that has a Byte datatype. I also have individual band images for R, G, Redge, and NIR that are UInt16 datatypes. Since I’m missing the Blue band from the individual bands, I was attempting
to extract the blue band from the RGB composite image, scale it up to the UInt16 datatype, and build a composite VRT with R, G, B, NIR, RE bands included in it. I was then attempting to extract the RGB bands from the multispec VRT in order to see if the process
was working as intended, but I’m getting an extremely blue image.<br>
<br>
Can anyone shed some light as to what I may be doing wrong here?<br>
<br>
I started by building a VRT for each band:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">gdal_translate source_RGB.tif b.vrt -ot UInt16 -of VRT -b 3 -scale 0 255 0 65535
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">gdalbuildvrt -b 1 r.vrt source_R.tif<br>
gdalbuildvrt -b 1 g.vrt source_G.tif<br>
gdalbuildvrt -b 1 nir.vrt source_NIR.tif<br>
gdalbuildvrt -b 1 re.vrt source_RE.tif<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal">I then merged the VRTs:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">gdalbuildvrt -separate multispec.vrt r.vrt g.vrt b.vrt nir.vrt re.vrt<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal">I now have a multispec.vrt with the R, G, B, NIR, and RE bands, all with a UInt16 datatype.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Now, I attempted to rebuild a RGB GeoTiff from the composite VRT with something like:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">gdal_translate -ot Byte -of GTiff -b 1 -b 2 -b 3 -scale 0 65535 0 255 -co PHOTOMETRIC=RGB multispec.vrt multispec.tif<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Viewing the result in QGIS appears overly blue. What am I doing wrong here?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Nathan <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<DIV>
<hr><font size="1">This email transmission, including any attachments, is intended solely for the addressee named above, and may contain confidential or privileged information. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender immediately by reply email and destroy the message and its attachments.</font>
</DIV></body>
</html>