Guest User

Untitled

a guest
Aug 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Split tone effect using core image filters?
  2. | 1 0 0 -0.5 | | 1.5 0.0 0 0 | | 1 0 0 0.5 |
  3. | 0 1 0 -0.5 | + | 0 1.5 0 0 | + | 0 1 0 0.5 |
  4. | 0 0 1 -0.5 | | 0 0.0 0.66 0 | | 0 0 1 0.5 |
  5. | 0 0 0 1.0 | | 0 0.0 0.0 1.0| | 0 0 0 1.0 |
  6.  
  7. CIFilter *lightDark = [CIFilter filterWithName:@"CIFalseColor"
  8. keysAndValues: @"inputImage", helper.ciImage, nil];
  9. [lightDark setDefaults];
  10. CIColor *myBlue = [CIColor colorWithRed:0.0 green:0.0 blue:0.6 alpha:0.5];
  11. CIColor *myRed = [CIColor colorWithRed:1.0 green:0.8 blue:0.0 alpha:0.5];
  12.  
  13. [lightDark setValue:myBlue forKey:@"inputColor0"];
  14. [lightDark setValue:myRed forKey:@"inputColor1"];
  15. CIImage *mappedImage = [lightDark valueForKey:kCIOutputImageKey];
  16.  
  17. CIFilter *screenBlend = [CIFilter filterWithName:@"CIScreenBlendMode" keysAndValues: @"inputImage", mappedImage, @"inputBackgroundImage", helper.ciImage, nil];
  18. CIImage *finalImage = [screenBlend valueForKey:kCIOutputImageKey];
  19.  
  20. if (finalImage) imageView.image = [UIImage imageWithCIImage:finalImage orientation:orientation];
  21. else NSLog(@"Missing our image");
Add Comment
Please, Sign In to add comment