Answers.Body: <p>Default pixel format for <a href="https://ffmpeg.org/ffmpeg-filters.html#overlay" rel="nofollow noreferrer">overlay filte</a>r is yuv420p. Use the <code>format</code> option in overlay to set it as <code>auto</code> or <code>rgb</code>.</p>
  
  <pre><code>ffmpeg -y -i b.png -i a.png -filter_complex "[0:v]format=rgba[a]; [1:v]format=rgba[b]; [a][b]overlay=format=auto" normal.png
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-10T20:52:39.697Z
Answers.LastActivityDate: 2020-03-10T20:52:39.697Z
Answers.UserDisplayName: llogan
Body: <p>Trying a simple overlay example, getting nasty black fringes:</p>
  
  <pre><code>fmpeg -y -i b.png -i a.png -filter_complex "[0:v]format=rgba[a];
      [1:v]format=rgba[b];
      [a][b]overlay,format=rgba"  normal.png
  </code></pre>
  
  <p><a href="https://i.sstatic.net/xTiQY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xTiQY.png" alt="b"></a>
  <a href="https://i.sstatic.net/TJ12G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TJ12G.png" alt="a"></a>
  <a href="https://i.sstatic.net/ZZzAp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZZzAp.png" alt="result"></a>
  <a href="https://i.sstatic.net/w4Nog.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/w4Nog.png" alt="expected"></a></p>
  
  <p>Expected over Result zoomed in 
  <a href="https://i.sstatic.net/0UVQo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0UVQo.png" alt="expected vs result"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-10T08:27:06.860Z
Comments.Text: Open a ticket at trac.ffmpeg.org. Run your command with `-v verbose` added and capture log. Share full command and log there..
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-10T16:34:41.350Z
Comments.Text: Thanks, Gyan,  http://trac.ffmpeg.org/ticket/8563
Comments.UserDisplayName: QPM
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-10T17:35:47.027Z
Comments.Text: Workaround: `ffmpeg -y -i b.png -i a.png -filter_complex "[0:v]format=rgba[a];
      [1:v]format=rgba[b];
      [a][b]overlay=format=auto"  normal.png`
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-10T19:57:44.523Z
Comments.Text: @llogan add it as the answer. Explained at trac.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-10T20:53:31.970Z
Comments.Text: @Gyan Added. Would be nice if auto was the default.
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-11T04:47:29.470Z
Comments.Text: Yes, but at this stage, many scripts in use probably assume yuv420p output.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-11T17:16:26.300Z
Comments.Text: @Gyan Obviously, there is always the ever-present "scripts" argument, but I don't think that is reason enough.
Comments.UserDisplayName: llogan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-11T17:49:41.113Z
Comments.Text: Fine by me but good luck on the ML :)
Comments.UserDisplayName: Gyan
Tags: <ffmpeg>
Title: overlay filter with simple PNG adds black fringe
UserDisplayName: QPM
ThreadText: # overlay filter with simple PNG adds black fringe
  
  (Asked by: username_0 on 2020-03-10)
  
  Trying a simple overlay example, getting nasty black fringes:
  
  ```
  fmpeg -y -i b.png -i a.png -filter_complex "[0:v]format=rgba[a];
      [1:v]format=rgba[b];
      [a][b]overlay,format=rgba"  normal.png
  
  ```
  
  [![b](https://i.sstatic.net/xTiQY.png)](https://i.sstatic.net/xTiQY.png)
  [![a](https://i.sstatic.net/TJ12G.png)](https://i.sstatic.net/TJ12G.png)
  [![result](https://i.sstatic.net/ZZzAp.png)](https://i.sstatic.net/ZZzAp.png)
  [![expected](https://i.sstatic.net/w4Nog.png)](https://i.sstatic.net/w4Nog.png)
  
  Expected over Result zoomed in
  [![expected vs result](https://i.sstatic.net/0UVQo.png)](https://i.sstatic.net/0UVQo.png)
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Open a ticket at trac.ffmpeg.org. Run your command with `-v verbose` added and capture log. Share full command and log there..  
  > **username_0**: Thanks, username_1,  http://trac.ffmpeg.org/ticket/8563  
  > **username_2**: Workaround: `ffmpeg -y -i b.png -i a.png -filter_complex "[0:v]format=rgba[a];     [1:v]format=rgba[b];     [a][b]overlay=format=auto"  normal.png`  
  > **username_1**: @username_2 add it as the answer. Explained at trac.  
  > **username_2**: @username_1 Added. Would be nice if auto was the default.  
  > **username_1**: Yes, but at this stage, many scripts in use probably assume yuv420p output.  
  > **username_2**: @username_1 Obviously, there is always the ever-present "scripts" argument, but I don't think that is reason enough.  
  > **username_1**: Fine by me but good luck on the ML :)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-03-10. Score: 2 | Accepted answer
  
  Default pixel format for [overlay filte](https://ffmpeg.org/ffmpeg-filters.html#overlay)r is yuv420p. Use the `format` option in overlay to set it as `auto` or `rgb`.
  
  ```
  ffmpeg -y -i b.png -i a.png -filter_complex "[0:v]format=rgba[a]; [1:v]format=rgba[b]; [a][b]overlay=format=auto" normal.png
  
  ```
  
  
  ---
  
  