<div dir="ltr">Hello,<div><br></div><div>I use the OpenJPEG 2.0 driver to decode the JP2 images within NITF files (1B level NITF images from DigitalGlobe).  For 4 band images, the driver interprets the 4th band as Alpha.  When I warp the imagery using gdalwarp, the 4th band in the output is all zeros. If I convert the image using gdal_translate, the 11 bit values in the 4th band are truncated to 255.  Using GTiff creation options of PHOTOMETRIC=RGB or MINISBLACK and ALPHA=NO do not change the results.</div><div><br></div><div>I found this only occurs with the OpenJPEG driver. The Jasper, Kakadu, and ECW drivers interpret the 4th band as Undefined and the 4th band behaves normally in gdalwarp and gdal_translate.  I've tried gdal versions from 1.9.0 to 1.11.1.  I thought perhaps the issue would be solved in OpenJPEG 2.1, and so I tried compiling GDAL 1.11.1 with OpenJPEG 2.1.0.  But, that still resulted in the 4th band being read as Alpha.</div><div><br></div><div>I'd really like to continue using OpenJPEG since it will be so well supported in GDAL 2.0.  Anyone know a work around for this?  Is this a GDAL issue or an OpenJPEG issue?</div><div><br></div><div>Thanks,</div><div>Claire</div><div><br></div><div><br></div><div><b>gdalinfo using the OpenJPEG driver and GDAL 1.11.1:</b><br></div><div><div><br></div><div>OPENJPEG: info: Start to read j2k main header (0).</div><div>OPENJPEG: info: Main header has been correctly decoded.</div><div>GDAL: GDALOpen(/vsisubfile/3935_198497332,output/WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=0x948760) succeeds as JP2OpenJPEG.</div><div>GDAL: NITFDataset::Open() wasn't able to derive a first order</div><div>geotransform.  It will be returned as GCPs.</div><div>GDAL: GDALDefaultOverviews::OverviewScan()</div><div>GDAL: GDALOpen(output/WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=0x8bfd10) succeeds as NITF.</div><div>Driver: NITF/National Imagery Transmission Format</div><div>Files: output/WV02_12OCT082110317-M1BS-103001001B68B600.ntf</div><div>       output/WV02_12OCT082110317-M1BS-103001001B68B600.xml</div><div>Size is 9216, 8192</div><div>Coordinate System is `'</div><div>GCP Projection = </div><div>GEOGCS["WGS 84",</div><div>    DATUM["WGS_1984",</div><div>        SPHEROID["WGS 84",6378137,298.257223563,</div><div>...........</div><div>  SAMP_OFF=4409</div><div>  SAMP_SCALE=4410</div><div>Corner Coordinates:</div><div>Upper Left  (    0.0,    0.0)</div><div>Lower Left  (    0.0, 8192.0)</div><div>Upper Right ( 9216.0,    0.0)</div><div>Lower Right ( 9216.0, 8192.0)</div><div>Center      ( 4608.0, 4096.0)</div><div>Band 1 Block=1024x1024 Type=UInt16, ColorInterp=Blue</div><div>  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</div><div>  Overviews: arbitrary</div><div>  Image Structure Metadata:</div><div>    NBITS=11</div><div>Band 2 Block=1024x1024 Type=UInt16, ColorInterp=Green</div><div>  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</div><div>  Overviews: arbitrary</div><div>  Image Structure Metadata:</div><div>    NBITS=11</div><div>Band 3 Block=1024x1024 Type=UInt16, ColorInterp=Red</div><div>  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</div><div>  Overviews: arbitrary</div><div>  Image Structure Metadata:</div><div>    NBITS=11</div><div>Band 4 Block=1024x1024 Type=UInt16, ColorInterp=<b><i>Alpha</i></b></div><div>  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</div><div>  Overviews: arbitrary</div><div>  Image Structure Metadata:</div><div>    NBITS=11</div><div>GDAL: GDALClose(/vsisubfile/3935_198497332,output/WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=0x94d3f0)</div><div>GDAL: GDALClose(/vsisubfile/3935_198497332,output/WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=0x948760)</div><div>GDAL: GDALClose(output/WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=0x8bfd10)</div></div><div><br></div><div><br></div><div><b>gdalinfo using</b><b> ECW and 1.11.1 (Jasper and Kakadu are similar):</b></div><div><div style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><br></div><div style><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: NCScbmOpenFileView(/vsisubfile/3935_198497332,Z:\claire\debug_ortho\output2\WV02_12OCT082110317-M1BS-103001001B68B600.ntf): eErr=2, will try VSIL stream.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Got mutex.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_0.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_1.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_2.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_3.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_4.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_5.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_6.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_7.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: Using filename 'C:\Users\porte254\AppData\Local\Temp\99544_8.ntf' for temporary directory determination purposes.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">ECW: FileInfo: SizeXY=9216,8192 Bands=4</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">       OriginXY=0,0  CellIncrementXY=1,1</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">       ColorSpace=3, eCellType=1</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px"><br></span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">GDAL: GDALOpen(/vsisubfile/3935_198497332,Z:\claire\debug_ortho\output2\WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=000000000032FBA0) succeeds as JP2ECW.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">GDAL: NITFDataset::Open() wasn't able to derive a first order</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">geotransform.  It will be returned as GCPs.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">GDAL: GDALDefaultOverviews::OverviewScan()</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">GDAL: GDALOpen(Z:\claire\debug_ortho\output2\WV02_12OCT082110317-M1BS-103001001B68B600.ntf, this=000000000031EC40) succeeds as NITF.</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Driver: NITF/National Imagery Transmission Format</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Files: output2\WV02_12OCT082110317-M1BS-103001001B68B600.ntf</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">         output2\WV02_12OCT082110317-M1BS-103001001B68B600.XML</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Size is 9216, 8192</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Coordinate System is `'</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">GCP Projection = </span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">GEOGCS["WGS 84",</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">    DATUM["WGS_1984",</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">        SPHEROID["WGS 84",6378137,298.257223563,</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">        .....................................................</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  SAMP_OFF=4409</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  SAMP_SCALE=4410</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Corner Coordinates:</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Upper Left  (    0.0,    0.0)</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Lower Left  (    0.0, 8192.0)</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Upper Right ( 9216.0,    0.0)</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Lower Right ( 9216.0, 8192.0)</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Center      ( 4608.0, 4096.0)</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Band 1 Block=256x256 Type=UInt16, ColorInterp=Blue</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Image Structure Metadata:</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">    NBITS=11</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Band 2 Block=256x256 Type=UInt16, ColorInterp=Green</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Image Structure Metadata:</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">    NBITS=11</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Band 3 Block=256x256 Type=UInt16, ColorInterp=Red</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Image Structure Metadata:</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">    NBITS=11</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">Band 4 Block=256x256 Type=UInt16, ColorInterp=<b><i>Undefined</i></b></span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Overviews: 4608x4096, 2304x2048, 1152x1024, 576x512, 288x256</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">  Image Structure Metadata:</span></font></div><div style><font color="#000000" face="Tahoma"><span style="font-size:13.3333330154419px">    NBITS=11</span></font></div><div style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333330154419px"><br></div></div></div></div>