<p>The LUT filters don't have cross-referencing of channels. Use <code>geq</code> instead</p>

<p><code>geq=r='if(gt(g(X,Y),145),255,p(X,Y))':g='if(gt(g(X,Y),145),255,p(X,Y))':b='if(gt(g(X,Y),145),255,p(X,Y))'</code></p>

CC BY-SA 3.0
2017-07-29T17:12:28.120Z
Mulvya, thank you very much. This works exactly as it was intended.
Jay
CC BY-SA 3.0
2017-07-29T04:54:39.520Z
2017-07-29T04:54:39.520Z
Gyan
<p>I am using ffmpeg and trying to change the color of certain pixels in a video stream using the lutrgb filter. The aim is to change any pixel with a green value greater than 145 to a white pixel.
So far I have tried the following commands:</p>

<p>-vf lutrgb=r='if((g > 145),255,val)':g='if(val > 145, 255, val)':b='if(g > 145, 255, val)'</p>

<p>-vf lutrgb=g='if(val>145,255,val)':r=255:b=255</p>

<p>-vf lutrgb=r='if(gt(val,145),255,val)':g='if(val>145,255,val)':b='if(gt(val,145),255,val)'</p>

<p>However, these are not delivering the desired result. 
Is it possible to have ffmpeg use a 1D LUT where the input values for r, g and b can be set based on a condition, for example, if r=ANY, g>145 and b=ANY, then r=255, g=255 and b=255?
Any insight to whether this is possible is much appreciated.</p>

<ffmpeg><lut>
Can a 1D LUT be used in ffmpeg using lutrgb?
Jay
# Can a 1D LUT be used in ffmpeg using lutrgb?

(Asked by: username_0 on 2017-07-29)

I am using ffmpeg and trying to change the color of certain pixels in a video stream using the lutrgb filter. The aim is to change any pixel with a green value greater than 145 to a white pixel.
So far I have tried the following commands:

-vf lutrgb=r='if((g > 145),255,val)':g='if(val > 145, 255, val)':b='if(g > 145, 255, val)'

-vf lutrgb=g='if(val>145,255,val)':r=255:b=255

-vf lutrgb=r='if(gt(val,145),255,val)':g='if(val>145,255,val)':b='if(gt(val,145),255,val)'

However, these are not delivering the desired result.
Is it possible to have ffmpeg use a 1D LUT where the input values for r, g and b can be set based on a condition, for example, if r=ANY, g>145 and b=ANY, then r=255, g=255 and b=255?
Any insight to whether this is possible is much appreciated.

**Tags:** ffmpeg, lut


---

## 1 answers

### Answer by username_1 on 2017-07-29. Score: 2 | Accepted answer

The LUT filters don't have cross-referencing of channels. Use `geq` instead

`geq=r='if(gt(g(X,Y),145),255,p(X,Y))':g='if(gt(g(X,Y),145),255,p(X,Y))':b='if(gt(g(X,Y),145),255,p(X,Y))'`

> **Comments:**
> **username_0**: Mulvya, thank you very much. This works exactly as it was intended.  

---

