New filter colorenhance: increase color contrast of video#246
Open
cynthia2006 wants to merge 1 commit intodyne:masterfrom
Open
New filter colorenhance: increase color contrast of video#246cynthia2006 wants to merge 1 commit intodyne:masterfrom
cynthia2006 wants to merge 1 commit intodyne:masterfrom
Conversation
Member
|
Hi! We use https://www.conventionalcommits.org/ now (tl;dr commits prefixed with fix: or feat: ...) so that release automations can work. Would be grateful for adoption, else I'll mend the commit msg myself. |
Contributor
Author
|
Well, amend the commit message as you see fit. |
…ideo Colorenhance applies two sigmoidal filters on the A, B channels of a frame transferred into the Oklab colorspace. The intuition is trivial: L is the lightness channel and rest are color channels, so increasing the contrast of the two color channels end up increasing color contrast, without changing the lightness because Oklab is a perceptually uniform colorspace in comparison to HSV (or HSL).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Often pictures/video looks too faded, especially if not color graded, because the cause is color gamut is condensed around white. This filter strives to expand the gamut so colors appear vivid. Consequently, it works best for pictures/videos where color enhancement isn't already applied.
Note that, this isn't color grading — just increasing the color contrast. It works by applying two sigmoidal filters on the A, B channels of a picture/video frame transferred into the Oklab colorspace. The intuition behind implementing this filter is trivial: L is the lightness channel, and rest are color channels, so increasing the contrast of the two color channels end up increasing color contrast without changing the lightness, because Oklab is a perceptually uniform colorspace in comparison to HSV (or HSL).
Here are a few demonstrations.
(L: Original | R: Enhanced; Parameters:
0.55 0.40 0.50 0.50)(U: Original | L: Enhanced; Parameters:
0.58 0.48 0.48 0.50)