Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color mask #1

Open
fractalfantasy opened this issue Apr 29, 2021 · 1 comment
Open

color mask #1

fractalfantasy opened this issue Apr 29, 2021 · 1 comment

Comments

@fractalfantasy
Copy link

how do you determine the the color that needs to be inpainted?

I believe in the demo its using white

@tony-xlh
Copy link

tony-xlh commented Nov 1, 2024

These lines calculate the grayscale value based on the RGB values:

inpaint.js/demo.html

Lines 17 to 19 in e77a530

var Y = .299 * blah.data[4 * i] + .587 * blah.data[4 * i + 1] + .114 * blah.data[4 * i + 2];
if(Y > 230){

You can update these lines to use other colors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants