I have a video of a person on green background and I'm trying to turn background transparent:

ffmpeg -i bg.mp4 -i man.mp4 -filter_complex '[1:v]colorkey=0x00ff00:0.3:0.3[ckout];[0:v][ckout]overlay[out]' -map '[out]' result.mp4

Colorkey gives this quite noticeable green edge around the person's figure.
Any attempts to increase opacity or blend parameters result in disappearing facial features.

enter image description here

Is there any smart way to change pure green 0x00ff00 pixels with transparent ones?

1 Answer 1


To me it is just the matter of the edge color

The colorkey has a similarity parameter; should you try not using 1

Since i don't have any asset to try on this parameter, good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.