Body: <p>I do time lapses. In the attached image, notice each image has slightly different shades but are otherwise consistent. This is an artifact of a mechanical shutter.</p>
  <p><a href="https://i.sstatic.net/LLzeD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LLzeD.png" alt="Collection of slightly off image thumbnails" /></a></p>
  <p>I'd like to take a single pixel in the images that will not change color and use this as the baseline. Then apply a mask to the rest of the images in the sequence to make them match the baseline image.</p>
  <p>I imagine the code would look something like this:</p>
  <pre><code>baseline_color = `convert baseline.png -format '#%[hex:u.p{75,20}]' info:-`
  
  for i in images/
  do
      #get the color of the same pixel in another image
      new_color = `convert $i -format '#%[hex:u.p{75,20}]' info:-`
  
      #get the difference betwen the two colors
      diff = baseline_color - new_color
  
      #apply filter to make image color consistent with baseline
      ffmpeg -i $i -vf &quot;filter=...&quot; $i_filtered.png
  done
  </code></pre>
  <p>Any thoughts on how to best accomplish this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-17T23:10:03.640Z
Comments.Text: I may end up using [normalization](http://johnriselvato.com/ffmpeg-how-to-add-color-normalization-to-a-video/) instead
Comments.UserDisplayName: user319249
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-18T12:49:29.387Z
Comments.Text: Alternatively, the answer may lie in the curves filter if I can make it work. Then the pseudocode above would apply.
Comments.UserDisplayName: user319249
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-19T12:40:52.303Z
Comments.Text: Another option is the [histmatch](http://www.fmwconcepts.com/imagemagick/histmatch/index.php) ImageMagick script
Comments.UserDisplayName: user319249
Tags: <ffmpeg><filter><time-lapse>
Title: Applying dynamic mask across all images to make uniform with baseline
UserDisplayName: user319249
ThreadText: # Applying dynamic mask across all images to make uniform with baseline
  
  (Asked by: username_0 on 2022-08-17)
  
  I do time lapses. In the attached image, notice each image has slightly different shades but are otherwise consistent. This is an artifact of a mechanical shutter.
  
  [![Collection of slightly off image thumbnails](https://i.sstatic.net/LLzeD.png)](https://i.sstatic.net/LLzeD.png)
  
  I'd like to take a single pixel in the images that will not change color and use this as the baseline. Then apply a mask to the rest of the images in the sequence to make them match the baseline image.
  
  I imagine the code would look something like this:
  
  ```
  baseline_color = `convert baseline.png -format '#%[hex:u.p{75,20}]' info:-`
  
  for i in images/
  do
      #get the color of the same pixel in another image
      new_color = `convert $i -format '#%[hex:u.p{75,20}]' info:-`
  
      #get the difference betwen the two colors
      diff = baseline_color - new_color
  
      #apply filter to make image color consistent with baseline
      ffmpeg -i $i -vf "filter=..." $i_filtered.png
  done
  
  ```
  
  Any thoughts on how to best accomplish this?
  
  **Tags:** ffmpeg, filter, time-lapse
  
  > **Comments:**
  > **username_0**: I may end up using [normalization](http://johnriselvato.com/ffmpeg-how-to-add-color-normalization-to-a-video/) instead  
  > **username_0**: Alternatively, the answer may lie in the curves filter if I can make it work. Then the pseudocode above would apply.  
  > **username_0**: Another option is the [histmatch](http://www.fmwconcepts.com/imagemagick/histmatch/index.php) ImageMagick script  
  
  ---
  
  ## 0 answers
  
  