Opened 16 years ago

Closed 16 years ago

#2342 closed defect (duplicate)

NITF 4 band images (RGBA) have incorrect color model per band.

Reported by: ReinerBeck Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.5.1
Severity: normal Keywords: NITF
Cc:

Description

When converting a four band RGBA image to NITF, the color model (IREP) is set to "MONO" and the individual bands are each set to "M" (monochrome) as well.

GDAL should set the color model for the three RGB bands (IREPBANDn) to "R", "G", and "B". The alpha channel (or any other remaining channels) should be set to "M". More stringent NITF viewers will respect those settings and display the image correctly (with colors). Otherwise, the image is displayed as monochrome (that is only the first band). Tested with PAR GeoView.

The source image was the attached Blue Marble image.

The NITF image was created using the following command line:

gdal_translate -of NITF land_ocean_ice_2048.tif out.ntf



gdalinfo land_ocean_ice_2048.tif

Driver: GTiff/GeoTIFF
Files: /data/Raster/BlueMarble/land_ocean_ice_2048.tif
Size is 2048, 1024
Coordinate System is `'
Metadata:

TIFFTAG_XRESOLUTION=72
TIFFTAG_YRESOLUTION=72
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)

Image Structure Metadata:

COMPRESSION=LZW
INTERLEAVE=PIXEL

Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 1024.0)
Upper Right ( 2048.0, 0.0)
Lower Right ( 2048.0, 1024.0)
Center ( 1024.0, 512.0)
Band 1 Block=2048x1 Type=Byte, ColorInterp=Red
Band 2 Block=2048x1 Type=Byte, ColorInterp=Green
Band 3 Block=2048x1 Type=Byte, ColorInterp=Blue
Band 4 Block=2048x1 Type=Byte, ColorInterp=Undefined


gdalinfo out.ntf

Driver: NITF/National Imagery Transmission Format
Files: out.ntf

out.ntf.aux.xml

Size is 2048, 1024
Coordinate System is `'
Metadata:

NITF_FHDR=NITF02.10
NITF_CLEVEL=03
NITF_STYPE=BF01
NITF_OSTAID=GDAL
NITF_FDT=20021216151629
NITF_FTITLE=
NITF_FSCLAS=U
NITF_FSCLSY=
NITF_FSCODE=
NITF_FSCTLH=
NITF_FSREL=
NITF_FSDCTP=
NITF_FSDCDT=
NITF_FSDCXM=
NITF_FSDG=
NITF_FSDGDT=
NITF_FSCLTX=
NITF_FSCATP=
NITF_FSCAUT=
NITF_FSCRSN=
NITF_FSSRDT=
NITF_FSCTLN=
NITF_FSCOP=00000
NITF_FSCPYS=00000
NITF_ENCRYP=0
NITF_FBKGC= 0, 0, 0
NITF_ONAME=
NITF_OPHONE=
NITF_IID1=Missing NITF_IDATIM=20021216151629
NITF_TGTID=
NITF_IID2=
NITF_ISCLAS=U
NITF_ISCLSY=
NITF_ISCODE=
NITF_ISCTLH=
NITF_ISREL=
NITF_ISDCTP=
NITF_ISDCDT=
NITF_ISDCXM=
NITF_ISDG=
NITF_ISDGDT=
NITF_ISCLTX=
NITF_ISCATP=
NITF_ISCAUT=
NITF_ISCRSN=
NITF_ISSRDT=
NITF_ISCTLN=
NITF_ISORCE=Unknown
NITF_PVTYPE=INT
NITF_IREP=MONO
NITF_ICAT=VIS
NITF_ABPP=08
NITF_PJUST=R
NITF_IC=NC
NITF_IMODE=B
TIFFTAG_XRESOLUTION=72
TIFFTAG_YRESOLUTION=72
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)

Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 1024.0)
Upper Right ( 2048.0, 0.0)
Lower Right ( 2048.0, 1024.0)
Center ( 1024.0, 512.0)
Band 1 Block=2048x1 Type=Byte, ColorInterp=Gray
Band 2 Block=2048x1 Type=Byte, ColorInterp=Gray
Band 3 Block=2048x1 Type=Byte, ColorInterp=Gray
Band 4 Block=2048x1 Type=Byte, ColorInterp=Gray

Change History (1)

comment:1 by ReinerBeck, 16 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.