Answers.Body: <p>There is no white color. That's the background color of the page showing through. Your input PNG is palettized 8-bit image where black color indicates transparency.</p>
  
  <p>Apply the following filter to the image to convert black pixels to white and set a uniform transparency.</p>
  
  <pre><code>geq=r='if(p(X,Y),p(X,Y),255)':g='if(p(X,Y),p(X,Y),255)':b='if(p(X,Y),p(X,Y),255)':a=0.1
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-08T14:45:34.340Z
Answers.Text: I dont quite understand what do you mean by black color. I dont see any black color. Also, can you kindly explain what is p(X,Y)? The documentation says pixel at the current plane which is kind of vague.
Answers.UserDisplayName: user10024395
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-08T14:49:36.210Z
Answers.Text: The actual color stored in the PNG in the area of the 'f' is black, which the viewer interprets as transparency. My geq expr checks if a pixel is non-black. If so, it keeps it, else changes it to white.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-08T14:29:22.160Z
Answers.LastActivityDate: 2018-04-08T14:29:22.160Z
Answers.UserDisplayName: Gyan
Body: <p>I overlay using the following command:</p>
  
  <pre><code>ffmpeg -i video.mp4 -i logo.png -filter_complex "[1]geq=r='r(X,Y)':a=0.1[a];[0][a] overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0" out.mp4
  </code></pre>
  
  <p>I tried adjusting the opacity using </p>
  
  <pre><code>fmpeg -i video.mp4 -i logo.png -filter_complex "[1]format=rgba,geq=r='r(X,Y)':a='1*alpha(X,Y)'[a];[0][a] overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0" out.mp4
  </code></pre>
  
  <p>but it is still transparent at the white color part.</p>
  
  <p>It seems like the white color part has a transparency of 0, causing the second command to not work.</p>
  
  <p>Is there any reason why this is happening? The logo I tried is </p>
  
  <p><a href="https://i.sstatic.net/dMICv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dMICv.png" alt="enter image description here"></a></p>
  
  <p>How can I preserve the white color?</p>
  
Tags: <video><ffmpeg><filter>
Title: Why when I overlay a logo on top of the video, the white color part of the logo is transparent?
UserDisplayName: user10024395
ThreadText: # Why when I overlay a logo on top of the video, the white color part of the logo is transparent?
  
  (Asked by: username_0 on 2018-04-08)
  
  I overlay using the following command:
  
  ```
  ffmpeg -i video.mp4 -i logo.png -filter_complex "[1]geq=r='r(X,Y)':a=0.1[a];[0][a] overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0" out.mp4
  
  ```
  
  I tried adjusting the opacity using
  
  ```
  fmpeg -i video.mp4 -i logo.png -filter_complex "[1]format=rgba,geq=r='r(X,Y)':a='1*alpha(X,Y)'[a];[0][a] overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0" out.mp4
  
  ```
  
  but it is still transparent at the white color part.
  
  It seems like the white color part has a transparency of 0, causing the second command to not work.
  
  Is there any reason why this is happening? The logo I tried is
  
  [![enter image description here](https://i.sstatic.net/dMICv.png)](https://i.sstatic.net/dMICv.png)
  
  How can I preserve the white color?
  
  **Tags:** video, ffmpeg, filter
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-04-08. Score: 1
  
  There is no white color. That's the background color of the page showing through. Your input PNG is palettized 8-bit image where black color indicates transparency.
  
  Apply the following filter to the image to convert black pixels to white and set a uniform transparency.
  
  ```
  geq=r='if(p(X,Y),p(X,Y),255)':g='if(p(X,Y),p(X,Y),255)':b='if(p(X,Y),p(X,Y),255)':a=0.1
  
  ```
  
  > **Comments:**
  > **username_0**: I dont quite understand what do you mean by black color. I dont see any black color. Also, can you kindly explain what is p(X,Y)? The documentation says pixel at the current plane which is kind of vague.  
  > **username_1**: The actual color stored in the PNG in the area of the 'f' is black, which the viewer interprets as transparency. My geq expr checks if a pixel is non-black. If so, it keeps it, else changes it to white.  
  
  ---
  
  