<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>

CC BY-SA 4.0
2020-03-10T20:52:39.697Z
2020-03-10T20:52:39.697Z
llogan
<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>

CC BY-SA 4.0
2020-03-10T08:27:06.860Z
Open a ticket at trac.ffmpeg.org. Run your command with `-v verbose` added and capture log. Share full command and log there..
Gyan
CC BY-SA 4.0
2020-03-10T16:34:41.350Z
Thanks, Gyan,  http://trac.ffmpeg.org/ticket/8563
QPM
CC BY-SA 4.0
2020-03-10T17:35:47.027Z
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`
llogan
CC BY-SA 4.0
2020-03-10T19:57:44.523Z
@llogan add it as the answer. Explained at trac.
Gyan
CC BY-SA 4.0
2020-03-10T20:53:31.970Z
@Gyan Added. Would be nice if auto was the default.
llogan
CC BY-SA 4.0
2020-03-11T04:47:29.470Z
Yes, but at this stage, many scripts in use probably assume yuv420p output.
Gyan
CC BY-SA 4.0
2020-03-11T17:16:26.300Z
@Gyan Obviously, there is always the ever-present "scripts" argument, but I don't think that is reason enough.
llogan
CC BY-SA 4.0
2020-03-11T17:49:41.113Z
Fine by me but good luck on the ML :)
Gyan
<ffmpeg>
overlay filter with simple PNG adds black fringe
QPM
# 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





Expected over Result zoomed in

**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 filter 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


---

