Answers.Body: <p>Here's the details on what the presets do:</p>
  
  <pre><code>[PRESET_COLOR_NEGATIVE] = {
      "0/1 0.129/1 0.466/0.498 0.725/0 1/0",
      "0/1 0.109/1 0.301/0.498 0.517/0 1/0",
      "0/1 0.098/1 0.235/0.498 0.423/0 1/0",
  },
  [PRESET_CROSS_PROCESS] = {
      "0.25/0.156 0.501/0.501 0.686/0.745",
      "0.25/0.188 0.38/0.501 0.745/0.815 1/0.815",
      "0.231/0.094 0.709/0.874",
  },
  [PRESET_DARKER]             = { .master = "0.5/0.4" },
  [PRESET_INCREASE_CONTRAST]  = { .master = "0.149/0.066 0.831/0.905 0.905/0.98" },
  [PRESET_LIGHTER]            = { .master = "0.4/0.5" },
  [PRESET_LINEAR_CONTRAST]    = { .master = "0.305/0.286 0.694/0.713" },
  [PRESET_MEDIUM_CONTRAST]    = { .master = "0.286/0.219 0.639/0.643" },
  [PRESET_NEGATIVE]           = { .master = "0/1 1/0" },
  [PRESET_STRONG_CONTRAST]    = { .master = "0.301/0.196 0.592/0.6 0.686/0.737" },
  [PRESET_VINTAGE] = {
      "0/0.11 0.42/0.51 1/0.95",
      "0.50/0.48",
      "0/0.22 0.49/0.44 1/0.8",
  }
  </code></pre>
  
  <p>For each preset, each <code>x/y</code> pair maps input <code>x</code> to output <code>y</code>, where the range is <code>0-1</code>. If not set, the filter automatically sets <code>0/0</code> and <code>1/1</code> i.e. input black = output black and input white = output white. Whereas <code>0/1</code> would mean set input black pixels to white in output. Where you have multiple pairs in quotes, separated by commas, the sequence is <code>"R","G","B"</code> mapping. The interpolation between the points is <em>natural cubic spline</em>. </p>
  
  <hr>
  
  <p>For auto leveling, a crude method would be use the <code>autolevels</code> subfilter of the <code>pp</code> filter.</p>
  
  <pre><code>ffmpeg -i input.mp4 -vf pp=al output.mp4
  </code></pre>
  
  <p>What this does is stretch luminance to full range.</p>
  
  <hr>
  
  <p>To check levels before (and after) any adjustment you do, you can generate a RGB parade for a frame like so</p>
  
  <pre><code>ffmpeg -i input.mp4 -vf "format=rgb24,waveform=c=7:d=parade,scale=1200x512" -vframes 1 frame1parade.png
  </code></pre>
  
  <p>For a specific frame, use</p>
  
  <pre><code>ffmpeg -ss 12.4 -i input.mp4 -vf "format=rgb24,waveform=c=7:d=parade,scale=1200x512" -vframes 1 frameNparade.png
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-31T18:33:10.713Z
Answers.Text: Relevant update: [lavfi/curves: do not automatically insert points at x=0 and x=1](http://git.videolan.org/?p=ffmpeg.git;a=commit;h=5c14018fc4f6ae9fcce7eaf8dd2d66cb6fbfc7bc).
Answers.UserDisplayName: llogan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-18T14:58:13.843Z
Answers.LastActivityDate: 2016-03-18T14:58:13.843Z
Answers.UserDisplayName: Gyan
Body: <p>Looking at the documentation about filters there seems to be a <a href="http://www.ffmpeg.org/ffmpeg-filters.html#curves-1" rel="noreferrer">curve</a> filter to manipulate color with the following presets:</p>
  
  <ul>
  <li>color_negative</li>
  <li>cross_process</li>
  <li>darker</li>
  <li>increase_contrast</li>
  <li>lighter</li>
  <li>linear_contrast</li>
  <li>medium_contrast</li>
  <li>negative</li>
  <li>strong_contrast</li>
  <li>vintage</li>
  </ul>
  
  <p>Unfortunately the documentation doesn't mention what these presets do or what their parameters are. I'm looking for a simple option to take a video and auto level colors for all the frames. Does any of these presets do that?</p>
  
Tags: <ffmpeg><color-correction><filter>
Title: What is the ffmpeg filter equivalent of "Automatic levels" for colors?
UserDisplayName: Grzegorz Adam Hankiewicz
ThreadText: # What is the ffmpeg filter equivalent of "Automatic levels" for colors?
  
  (Asked by: username_0 on 2015-01-18)
  
  Looking at the documentation about filters there seems to be a [curve](http://www.ffmpeg.org/ffmpeg-filters.html#curves-1) filter to manipulate color with the following presets:
  
  * color\_negative
  * cross\_process
  * darker
  * increase\_contrast
  * lighter
  * linear\_contrast
  * medium\_contrast
  * negative
  * strong\_contrast
  * vintage
  
  Unfortunately the documentation doesn't mention what these presets do or what their parameters are. I'm looking for a simple option to take a video and auto level colors for all the frames. Does any of these presets do that?
  
  **Tags:** ffmpeg, color-correction, filter
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-18. Score: 9 | Accepted answer
  
  Here's the details on what the presets do:
  
  ```
  [PRESET_COLOR_NEGATIVE] = {
      "0/1 0.129/1 0.466/0.498 0.725/0 1/0",
      "0/1 0.109/1 0.301/0.498 0.517/0 1/0",
      "0/1 0.098/1 0.235/0.498 0.423/0 1/0",
  },
  [PRESET_CROSS_PROCESS] = {
      "0.25/0.156 0.501/0.501 0.686/0.745",
      "0.25/0.188 0.38/0.501 0.745/0.815 1/0.815",
      "0.231/0.094 0.709/0.874",
  },
  [PRESET_DARKER]             = { .master = "0.5/0.4" },
  [PRESET_INCREASE_CONTRAST]  = { .master = "0.149/0.066 0.831/0.905 0.905/0.98" },
  [PRESET_LIGHTER]            = { .master = "0.4/0.5" },
  [PRESET_LINEAR_CONTRAST]    = { .master = "0.305/0.286 0.694/0.713" },
  [PRESET_MEDIUM_CONTRAST]    = { .master = "0.286/0.219 0.639/0.643" },
  [PRESET_NEGATIVE]           = { .master = "0/1 1/0" },
  [PRESET_STRONG_CONTRAST]    = { .master = "0.301/0.196 0.592/0.6 0.686/0.737" },
  [PRESET_VINTAGE] = {
      "0/0.11 0.42/0.51 1/0.95",
      "0.50/0.48",
      "0/0.22 0.49/0.44 1/0.8",
  }
  
  ```
  
  For each preset, each `x/y` pair maps input `x` to output `y`, where the range is `0-1`. If not set, the filter automatically sets `0/0` and `1/1` i.e. input black = output black and input white = output white. Whereas `0/1` would mean set input black pixels to white in output. Where you have multiple pairs in quotes, separated by commas, the sequence is `"R","G","B"` mapping. The interpolation between the points is *natural cubic spline*.
  
  ---
  
  For auto leveling, a crude method would be use the `autolevels` subfilter of the `pp` filter.
  
  ```
  ffmpeg -i input.mp4 -vf pp=al output.mp4
  
  ```
  
  What this does is stretch luminance to full range.
  
  ---
  
  To check levels before (and after) any adjustment you do, you can generate a RGB parade for a frame like so
  
  ```
  ffmpeg -i input.mp4 -vf "format=rgb24,waveform=c=7:d=parade,scale=1200x512" -vframes 1 frame1parade.png
  
  ```
  
  For a specific frame, use
  
  ```
  ffmpeg -ss 12.4 -i input.mp4 -vf "format=rgb24,waveform=c=7:d=parade,scale=1200x512" -vframes 1 frameNparade.png
  
  ```
  
  > **Comments:**
  > **username_2**: Relevant update: [lavfi/curves: do not automatically insert points at x=0 and x=1](http://git.videolan.org/?p=ffmpeg.git;a=commit;h=5c14018fc4f6ae9fcce7eaf8dd2d66cb6fbfc7bc).  
  
  ---
  
  