Open Pranoy1c opened 5 years ago
I am trying to replace the black/dark gray with a pure black image in this image using GPUImageChromaKeyBlendFilter but it seems to be replacing the whites too:
Here's my code:
stillImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"head.jpg"]]; blackImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"black.jpg"]]; filter = [[GPUImageChromaKeyBlendFilter alloc] init]; [(GPUImageChromaKeyBlendFilter *)filter setColorToReplaceRed:0.27 green:1.0 blue:1.0]; [(GPUImageChromaKeyBlendFilter *)filter setThresholdSensitivity:self.myslider.value]; [stillImageSource addTarget:filter]; [blackImageSource addTarget:filter]; [filter addTarget:self.mygpuimageview]; [stillImageSource processImage]; [blackImageSource processImage];
How can I make this work?
I notice in this post, you mention the issue is due to removing luminance: https://github.com/BradLarson/GPUImage/issues/2256
Is there a way to keep luminance in account too when keying?
I am trying to replace the black/dark gray with a pure black image in this image using GPUImageChromaKeyBlendFilter but it seems to be replacing the whites too:
Here's my code:
How can I make this work?
I notice in this post, you mention the issue is due to removing luminance: https://github.com/BradLarson/GPUImage/issues/2256
Is there a way to keep luminance in account too when keying?