Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Split tone effect using core image filters?
- | 1 0 0 -0.5 | | 1.5 0.0 0 0 | | 1 0 0 0.5 |
- | 0 1 0 -0.5 | + | 0 1.5 0 0 | + | 0 1 0 0.5 |
- | 0 0 1 -0.5 | | 0 0.0 0.66 0 | | 0 0 1 0.5 |
- | 0 0 0 1.0 | | 0 0.0 0.0 1.0| | 0 0 0 1.0 |
- CIFilter *lightDark = [CIFilter filterWithName:@"CIFalseColor"
- keysAndValues: @"inputImage", helper.ciImage, nil];
- [lightDark setDefaults];
- CIColor *myBlue = [CIColor colorWithRed:0.0 green:0.0 blue:0.6 alpha:0.5];
- CIColor *myRed = [CIColor colorWithRed:1.0 green:0.8 blue:0.0 alpha:0.5];
- [lightDark setValue:myBlue forKey:@"inputColor0"];
- [lightDark setValue:myRed forKey:@"inputColor1"];
- CIImage *mappedImage = [lightDark valueForKey:kCIOutputImageKey];
- CIFilter *screenBlend = [CIFilter filterWithName:@"CIScreenBlendMode" keysAndValues: @"inputImage", mappedImage, @"inputBackgroundImage", helper.ciImage, nil];
- CIImage *finalImage = [screenBlend valueForKey:kCIOutputImageKey];
- if (finalImage) imageView.image = [UIImage imageWithCIImage:finalImage orientation:orientation];
- else NSLog(@"Missing our image");
Add Comment
Please, Sign In to add comment