I have an output from 3rd party program in TIFF format where gdalinfo gives the following information:
Driver: GTiff/GeoTIFF
Files: J:\ascend\Lufthavne - ImgRAW\S°nderborg\ortho\sonderborg_ortho_gsd13-0-2.tif
Size is 16384, 16384
Coordinate System is:
PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]
Origin = (543741.728819748040000,6094062.354004472500000)
Pixel Size = (0.126364000000002,-0.126364000000024)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 543741.729, 6094062.354) ( 9d41' 1.18"E, 54d59'29.50"N)
Lower Left ( 543741.729, 6091992.006) ( 9d41' 0.05"E, 54d58'22.53"N)
Upper Right ( 545812.077, 6094062.354) ( 9d42'57.66"E, 54d59'28.83"N)
Lower Right ( 545812.077, 6091992.006) ( 9d42'56.47"E, 54d58'21.86"N)
Center ( 544776.903, 6093027.180) ( 9d41'58.84"E, 54d58'55.68"N)
Band 1 Block=16384x32 Type=Byte, ColorInterp=Red
Mask Flags: PER_DATASET ALPHA
Band 2 Block=16384x32 Type=Byte, ColorInterp=Green
Mask Flags: PER_DATASET ALPHA
Band 3 Block=16384x32 Type=Byte, ColorInterp=Blue
Mask Flags: PER_DATASET ALPHA
Band 4 Block=16384x32 Type=Byte, ColorInterp=Alpha
Then if I do:
C:\Python\WinPython-64bit-2.7.6.4-gdal\python-2.7.6.amd64>%GDAL%/gdal_translate -co PREDICTOR=2 -co COMPRESS=LZW "J:\ascend\Lufthavne - ImgRAW\Sønderborg\ortho\sonderborg_ortho_gsd13-0-2.tif" "J:\ascend\Lufthavne - ImgRAW\Sønderborg\ortho_compressed\sonderborg_ortho_gsd13-0-2.tif"
I get the following information:
Driver: GTiff/GeoTIFF
Files: J:\ascend\Lufthavne - ImgRAW\S°nderborg\ortho_compressed\sonderborg_ortho_gsd13-0-2.tif
Size is 16384, 16384
Coordinate System is:
PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]
Origin = (543741.728819748040000,6094062.354004472500000)
Pixel Size = (0.126364000000002,-0.126364000000024)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 543741.729, 6094062.354) ( 9d41' 1.18"E, 54d59'29.50"N)
Lower Left ( 543741.729, 6091992.006) ( 9d41' 0.05"E, 54d58'22.53"N)
Upper Right ( 545812.077, 6094062.354) ( 9d42'57.66"E, 54d59'28.83"N)
Lower Right ( 545812.077, 6091992.006) ( 9d42'56.47"E, 54d58'21.86"N)
Center ( 544776.903, 6093027.180) ( 9d41'58.84"E, 54d58'55.68"N)
Band 1 Block=16384x1 Type=Byte, ColorInterp=Red
Mask Flags: PER_DATASET ALPHA
Band 2 Block=16384x1 Type=Byte, ColorInterp=Green
Mask Flags: PER_DATASET ALPHA
Band 3 Block=16384x1 Type=Byte, ColorInterp=Blue
Mask Flags: PER_DATASET ALPHA
Band 4 Block=16384x1 Type=Byte, ColorInterp=Alpha
Can someone explain the changes? File went from 500mb to 250mb and I am wondering if my changes to the file have any meaning in terms of loosing information or if there is applications that can't handle the changed GeoTIFF file based on the information given from gdalinfo.
Then I also tried the last little thing, knowing that JPEG is not a lossless compression:
C:\Python\WinPython-64bit-2.7.6.4-gdal\python-2.7.6.amd64>%GDAL%/gdal_translate -b 1 -b 2 -b 3 -co COMPRESS=JPEG -co JPEG_QUALITY=95 -co PHOTOMETRIC=YCBCR "J:\ascend\Lufthavne - ImgRAW\Sønderborg\ortho\sonderborg_ortho_gsd13-0-2.tif" "J:\ascend\Lufthavne - ImgRAW\Sønderborg\ortho_compressed_loosy\sonderborg_ortho_gsd13-0-2.tif"
Which gives a file with only 50mb.
Driver: GTiff/GeoTIFF
Files: J:\ascend\Lufthavne - ImgRAW\S°nderborg\ortho_compressed_loosy\sonderborg_ortho_gsd13-0-2.tif
Size is 16384, 16384
Coordinate System is:
PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]
Origin = (543741.728819748040000,6094062.354004472500000)
Pixel Size = (0.126364000000002,-0.126364000000024)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=YCbCr JPEG
INTERLEAVE=PIXEL
SOURCE_COLOR_SPACE=YCbCr
Corner Coordinates:
Upper Left ( 543741.729, 6094062.354) ( 9d41' 1.18"E, 54d59'29.50"N)
Lower Left ( 543741.729, 6091992.006) ( 9d41' 0.05"E, 54d58'22.53"N)
Upper Right ( 545812.077, 6094062.354) ( 9d42'57.66"E, 54d59'28.83"N)
Lower Right ( 545812.077, 6091992.006) ( 9d42'56.47"E, 54d58'21.86"N)
Center ( 544776.903, 6093027.180) ( 9d41'58.84"E, 54d58'55.68"N)
Band 1 Block=16384x16 Type=Byte, ColorInterp=Red
Band 2 Block=16384x16 Type=Byte, ColorInterp=Green
Band 3 Block=16384x16 Type=Byte, ColorInterp=Blue
By inspecting manually, I really can't see any difference in colors in the images, but the last TIFF file is only 50mb in comparison to the original 500mb. Providing maps for really huge areas, the drop in data actually means a lot in terms of price of storing all this data, even though data is cheap.
What's the best arguments to justify to a data scientist or GIS guy, that the JPEG version is good enough?