<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.14">
<TITLE>GDAL_warp output image sizes vary.... Why?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hey folks</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I am batching the georef of a bunch of images and find GREAT variances between input and output file sizes….</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">As the input file size is pretty consistent, and the same X,Y points are used for GCP's in each image and the outsize option is set for 67% I would expect a consisent drop in file sizes.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Why is this not the case? Why do the gdal_warp images maintain their appropriate file sizes? And how can I add this condition in?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Note. Images start off as 32 bit and end off at 16bit (there is a 50% drop already).</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I have had cases where the output file is as large as 50 MEGS…. </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Why would the output file be larger than the intermediate file?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Anyone explain this?</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">This is a sample script</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.002213 45.584502 -gcp 1248.85 12074.39 -73.976008 45.594211 -gcp 1238.96 341.61 -73.95824 45.570552 -gcp 12981.31 341.61 -73.984438 45.560847 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_001.tif .\work\iA74_001.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_001.tif .\output\oA74_1.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.020358 45.578035 -gcp 1248.85 12074.39 -73.993978 45.587504 -gcp 1238.96 341.61 -73.976652 45.563685 -gcp 12981.31 341.61 -74.003023 45.55422 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_003.tif .\work\iA74_003.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_003.tif .\output\oA74_3.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.036225 45.579734 -gcp 1248.85 12074.39 -74.007057 45.583378 -gcp 1238.96 341.61 -74.000396 45.557043 -gcp 12981.31 341.61 -74.029551 45.553401 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_004.tif .\work\iA74_004.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_004.tif .\output\oA74_4.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.044881 45.581698 -gcp 1248.85 12074.39 -74.015255 45.581771 -gcp 1238.96 341.61 -74.01513 45.555024 -gcp 12981.31 341.61 -74.044742 45.554951 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_005.tif .\work\iA74_005.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_005.tif .\output\oA74_5.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.06504 45.585733 -gcp 1248.85 12074.39 -74.035766 45.582529 -gcp 1238.96 341.61 -74.041636 45.556102 -gcp 12981.31 341.61 -74.070897 45.559304 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_007.tif .\work\iA74_007.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_007.tif .\output\oA74_7.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.08218 45.58133 -gcp 1248.85 12074.39 -74.052898 45.584496 -gcp 1238.96 341.61 -74.04711 45.55806 -gcp 12981.31 341.61 -74.076378 45.554894 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_008.tif .\work\iA74_008.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_008.tif .\output\oA74_8.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.091197 45.582613 -gcp 1248.85 12074.39 -74.061579 45.583126 -gcp 1238.96 341.61 -74.060646 45.556387 -gcp 12981.31 341.61 -74.09025 45.555874 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_009.tif .\work\iA74_009.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_009.tif .\output\oA74_9.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">gdal_translate -gcp 12981.31 12074.39 -74.102078 45.582808 -gcp 1248.85 12074.39 -74.072451 45.582883 -gcp 1238.96 341.61 -74.072321 45.556136 -gcp 12981.31 341.61 -74.101934 45.556061 -scale -ot byte -outsize 67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area" A74_010.tif .\work\iA74_010.tif</FONT></P>
<P><FONT SIZE=2 FACE="Arial">gdalwarp -t_srs epsg:4326 .\work\iA74_010.tif .\output\oA74_10.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">rmdir /S /Q work</FONT>
<BR><FONT SIZE=2 FACE="Arial">rmdir work</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2 FACE="Arial">This is a snapshot of input file sizes:</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_001.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_003.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_004.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_005.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_006.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_007.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_008.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_009.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">98,402,364 A74_010.tif</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Here is a snapshot of intermediate files sizes.</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_001.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_003.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_004.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_005.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_007.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_008.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_009.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,166,568 iA74_010.tif</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">This is a snapshot of output filesizes.</FONT>
<BR><FONT SIZE=2 FACE="Arial">31,590,866 oA74_1.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,688,710 oA74_10.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">31,528,630 oA74_3.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">27,565,240 oA74_4.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">22,693,186 oA74_5.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">33,634,388 oA74_7.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">27,024,772 oA74_8.tif</FONT>
<BR><FONT SIZE=2 FACE="Arial">23,396,196 oA74_9.tif</FONT>
</P>
<BR>
</BODY>
</HTML>