OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.34k stars 541 forks source link

Chroma key fuzzez scrolling text and leaves border around chrama keyed image #4869

Closed Klawdek closed 1 year ago

Klawdek commented 2 years ago

Describe the bug: I made some scrolling text in Windows Movie Maker. (nothing else does scrolling text like WMM) It had yellow text with a black border on a solid white background. The background image was made in gimp and is solid white. So this should have been a real simple chroma key operation given the background has every pixel the EXACT same color and that color is not even close to any other color in the image. First I did the chroma key and all I did was select the color from the screen. That results in the text being screwed up with artifacts. It also leaves a white border on the image. (see screenshots) Then I tried setting the threshold all the way up it makes the text better but still leave the white border.

Steps to reproduce the behavior:

  1. Make a scrolling text image in WMM or maybe even some other program.
  2. Drop it into OpenShot
  3. Chroma key out the white with the pick screen color.
  4. See error
  5. Now adjust threshold all the way up
  6. See that the text is better but still has a white border.

Expected behavior: The white should have been completely taken out upon selecting white color. There should be no issues with text being taken out as well or with a white border that cannot be gotten rid of.

System Details:

Log Files: If you are experiencing a crash, please collect and attach logs of the problem. Log files can be found in the .openshot_qt folder in your user home directory. Log files over 2 MB in size will need to be compressed, please attach a ZIP file instead of the raw logs.

Exception / Stacktrace: If you are experiencing a crash or strange output on the command line, please attach a small snippet of the exception here, but please keep it as small as possible (for readability).

Screenshots: (Optional) OpenShot Chroma key using just the screen color picker to pick the white and everything else at the defaults. Screenshot (15785) OpenShot Chroma key using the screen color picker to pick the white and threshold set to max. NOTE the white border which is much more noticeable in the video than in a sreenshot. This is more noticeable in the video because it pops in when the text scroll starts and goes away when it ends . Screenshot (15786) I am also experimenting with Shotcut to see which is better to use for my projects. These were done in Shotcut using the same exact source files. Here is screenshot of my attempts to do the same thing in Shotcut: First what it looks like with just the white color chosen from the screen color picker and everything else at the dafaults: Note it has a white border too but the text looks much better than in OpenShot Screenshot (15787)

This is what it looks like in Shotcut after adjusting a distance setting to 50% (any more and it starts ruining the text) Note that it too has a white border. Screenshot (15788)

Both programs are incapable of doing the effect properly. Both require a white border that cannot be eliminated. However the text looks better and the white border is little fainter and less noticeable in Shotcut

The differences are much more noticeable in the video than in the screenshots.

JacksonRG commented 2 years ago

I've been looking into this and doing some testing. Looks like the white border you're seeing are actually greyish pixels where your scrolling text video had to compromise between the black outline and the white background. Any software will have some trouble with this, and the best thing to do would be use a transparent image for your captions.

However, here's somethings you can do to sharpen up the lines.

Here's what I started with: Screenshot from 2022-07-26 13-36-02

Here's where I got. Screenshot from 2022-07-26 13-46-20

1) Start by putting a Brightness & Contrast effect on your scrolling text. 1) With it selected, use Ctrl + Right/Left arrow to find the first frame. 1) Set the contrast all the way to 100. (or double click to enter a value as high as 250) 1) Now Put a Chroma Key on. 1) Set the color to a value of 215, Hue and saturation of 0. (We're not going for 255, because we want to catch as many gray pixels as we can. Screenshot from 2022-07-26 13-57-40 1) If there's still a border, you can add an extra chroma key effect with a lower Value or double click the threshold and override it as high as 300. (Above this number causes issues)

The reason for all that is the pixels on the edge of the letters aren't actually white, but this should filter out a lot more of them.

stale[bot] commented 1 year ago

Thank you so much for submitting an issue to help improve OpenShot Video Editor. We are sorry about this, but this particular issue has gone unnoticed for quite some time. To help keep the OpenShot GitHub Issue Tracker organized and focused, we must ensure that every issue is correctly labelled and triaged, to get the proper attention.

This issue will be closed, as it meets the following criteria:

We'd like to ask you to help us out and determine whether this issue should be reopened.

Thanks again for your help!