
Using the split, format, geq, and overlay filters:
ffmpeg -i input.jpg -filter_complex "[0]split[v0][v1];[v0]format=rgba,geq=r=0:g=0:b=0:a=255*(Y/H)[fg];[v1][fg]overlay=format=auto" -frames:v 1 -q:v 2 out.jpg
- split - make two copies of the input: one for geq and the other for overlay
- format - make the input have alpha channel
- geq - create a gradient with alpha
- overlay - place gradient over original image

Another example but this adds the crop filter to halve the gradient so it stops in the middle:
ffmpeg -i input.jpg -filter_complex "[0]split[v0][v1];[v0]crop=iw:ih/2,format=rgba,geq=r=0:g=0:b=0:a=255*(Y/H)[fg];[v1][fg]overlay=0:H-h:format=auto" -frames:v 1 -q:v 2 out.jpg
There is probably a more efficient way to do this, but it works. See filter documentation.