<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Another alternative is GINA's (<a
href="http://www.gina.alaska.edu/projects/gina-tools/">http://www.gina.alaska.edu/projects/gina-tools/</a>)
<span style="color: rgb(0, 0, 0); font-family: Arial; font-size:
14px; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
display: inline !important; float: none; ">gdal_contrast_stretch</span>:<br>
<br>
Usage: gdal_contrast_stretch.exe <src.tif> <dst.tif><br>
{ { -linear-stretch <target_avg> <target_stddev> } |<br>
{ -percentile-range <from: 0.0-1.0> <to: 0.0-1.0> }
|<br>
{ -histeq <target_stddev> } }<br>
[ -ndv <no_data_val> ]<br>
Input must be either 8-bit or 16-bit. Output is 8-bit.<br>
<br>
I think the input can be any GDAL supported raster type.<br>
<pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
<br>
On 4/24/2012 2:53 AM, <a class="moz-txt-link-abbreviated" href="mailto:jr.morreale@enoreth.net">jr.morreale@enoreth.net</a> wrote:
<blockquote cite="mid:d838afbd7b4ce7a5f51befaffaec9907@enoreth.net"
type="cite">On Tue, 24 Apr 2012 09:38:44 +0200, Even Rouault
wrote:
<br>
<blockquote type="cite">
<blockquote type="cite">
<br>
thanks for the reply, I did try with NBITS=8 and 12 with
osgeo4w's gdal
<br>
and tamas' nightly build but the output results are incorrect
<br>
<br>
Here is a sample file (93Mo) :
<br>
<a class="moz-txt-link-freetext" href="http://dl.free.fr/iFT4hH3Yj">http://dl.free.fr/iFT4hH3Yj</a>
<br>
<br>
I'll try to rebuild gdal on my linux box with the internal
libs
<br>
</blockquote>
<br>
I haven't looked at your result image, but you cannot just
specify NBITS=8 or
<br>
12, if the range of the values in the original file is full 16
bits.
<br>
<br>
You need to rescale the values, otherwise they will get clamped
to
<br>
[0, 255] or
<br>
[0, 4096].
<br>
<br>
So you can look for the min/max reported by gdalinfo -mm
<br>
uncompressed_original.tif
<br>
<br>
and then try :
<br>
<br>
gdal_translate -co "COMPRESS=JPEG" uncompressed_original.tif
compressed.tif
<br>
-scale min max 0 255 -ot Byte
<br>
<br>
or
<br>
<br>
gdal_translate -co "COMPRESS=JPEG" uncompressed_original.tif
compressed.tif
<br>
-scale min max 0 4095 -co NBITS=12
<br>
</blockquote>
<br>
Thanks, I didn't knew that !
<br>
<br>
The man says that you can omit the input min max scale so gdal
computes it for each source, however I can't find how to write
that correctly
<br>
_______________________________________________
<br>
gdal-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
<br>
<br>
</blockquote>
</body>
</html>