Saâd,<br><br>Can you provide the vrt file and the commands you used?<br><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 11:22 PM, Saâd HESSANE <span dir="ltr">&lt;<a href="mailto:saad.hessane@gmail.com">saad.hessane@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hy Chaitanya,<br><br>I applied a LUT to the VRT. It&#39;s work fine, and all pixel are between dst_min and dst_max.<br>
But why this is not work with the -scale parameter? The doc is clear : <a href="http://www.gdal.org/gdal_translate.html" target="_blank">http://www.gdal.org/gdal_translate.html</a>.<br>
&quot;Rescale the input pixels values from the range <i>src_min</i> to <i>src_max</i> to the range <i>dst_min</i> to <i>dst_max</i>.&quot; <br>Is it a bug?<div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">
2012/3/22 Chaitanya kumar CH <span dir="ltr">&lt;<a href="mailto:chaitanya.ch@gmail.com" target="_blank">chaitanya.ch@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Saâd,<br><br>It is better to have a combined LUT. It will save processing time and data degradation.<br>Be informed that GDAL VRT is not specialized for this work. To get a smooth curve as LUT, use some other graphics application that can handle 16bit rasters.<div>

<div><br>
<br><div class="gmail_quote">On Wed, Mar 21, 2012 at 6:00 AM, Saâd HESSANE <span dir="ltr">&lt;<a href="mailto:saad.hessane@gmail.com" target="_blank">saad.hessane@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Thank&#39;s all for your answers.<br>I will use the LUT method, cause is the most right for me.<br><br>Chaitanya said : &quot;Gamma correction is more related to displaying the data than the data itself&quot;.<br>Not in my case. I have to do this correction. But how to do that? Do i embed a VRT with a contrast correction LUT, in another VRT with a gamma correction LUT ? <span lang="en"><span>Or there is</span> <span>a method to</span> <span>declare</span> LUTs <span>in order</span> <span>to</span> <span>execute in the same vrt</span><span> ?</span></span><br>



<br>Thank&#39;s again !<div><div><br><br><br><div class="gmail_quote">2012/3/20 Brent Fraser <span dir="ltr">&lt;<a href="mailto:bfraser@geoanalytic.com" target="_blank">bfraser@geoanalytic.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    I like to use gdal_contrast_stretch from <a href="http://www.gina.alaska.edu/projects/gina-tools/" target="_blank">http://www.gina.alaska.edu/projects/gina-tools/</a>
    <br>
    <br>
    Usage: gdal_contrast_stretch &lt;src.tif&gt; &lt;dst.tif&gt;<br>
      { { -linear-stretch &lt;target_avg&gt; &lt;target_stddev&gt; } |<br>
        { -percentile-range &lt;from: 0.0-1.0&gt; &lt;to: 0.0-1.0&gt; }
    |<br>
        { -histeq &lt;target_stddev&gt; } }<br>
      [ -ndv &lt;no_data_val&gt; ]<br>
    Input must be either 8-bit or 16-bit.  Output is 8-bit.<br>
    <br>
    For example:<br>
    <br>
    gdal_contrast_stretch -percentile-range 0.02 0.98 input16bit.tif
    output8bit.tif
    <pre cols="72">Best Regards,
Brent Fraser</pre><div><div>
    <br>
    On 3/20/2012 9:55 AM, Saâd HESSANE wrote:
    </div></div><blockquote type="cite"><div><div>Hi list,<br>
      <br>
      I use gdal_translate to convert 16bits images to 8bits images. The
      gdal_translate have the -scale argument to specify the convertion
      range (source-&gt;destination).<br>
      If I change the destination range (dst_min and dst_max), I can do
      manually a brightness correction (also a contrast correction).<br>
      <br>
      But is there any way to do that with a Photoshop like method?<br>
      For example set a brightness to -50, a contrast to +8 and let
      gdal_translate do the job ?<br>
      <br>
      Also can I apply a gamma correction?<br>
      <br>
      I saw the VRT format and there&#39;s a way to apply a LUT. But I don&#39;t
      think a LUT of 65536 values is the best way to apply the
      correction.<br>
      <br>
      Also the VRT have the scale ratio and scale offset elements. I
      think it can be useful but I don&#39;t understand how use it...<br>
      <br>
      So simply put, my question : can I do a contrast, brightness or
      gamma correction to a raster with gdal?<br>
      <br>
      Thank you !<br>
      <br>
      PS : <span lang="en"><span>I apologize for</span> <span>my</span>
        <span>broken English</span><span> !<br>
        </span></span>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><div><pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
    </div></blockquote>
  </div>

</blockquote></div><br>
</div></div><br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><br></div></div><div><div>
-- <br>Best regards,<br>Chaitanya kumar CH.<br>
<br><a href="tel:%2B91-9494447584" value="+919494447584" target="_blank">+91-9494447584</a><br>17.2416N 80.1426E<br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>