Color Specific Hue/Saturation from Photoshop to iOS

大城市里の小女人 提交于 2019-12-08 02:04:11

问题


I'm trying to use GPUImage and CIFilter to map this filter. Please note, I need help mapping the color (Reds) specific (note: NOT Master, just Reds) photoshop element to iOS.

Does anyone know how to manipulate a CIFilter or GPUImage class to get the photoshop effect below in iOS?


回答1:


You could use GPUImage with the lookup filter:

GPUImageLookupFilter: Uses an RGB color lookup image to remap the colors in an image. First, use your favourite photo editing application to apply a filter to lookup.png from GPUImage/framework/Resources. For this to work properly each pixel color must not depend on other pixels (e.g. blur will not work). If you need a more complex filter you can create as many lookup tables as required. Once ready, use your new lookup.png file as a second input for GPUImageLookupFilter.

So apply all color filters in the lookup.png file from GPUImage in Photoshop, save it, then apply the filter:

- (UIImage *)applyMyFilter:(UIImage*)inputImage {
    //apply custom filter
    GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage];

    GPUImagePicture *lookupImageSource = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"my-lookup.png"]];
    GPUImageLookupFilter *lookupFilter = [[GPUImageLookupFilter alloc] init];
    [stillImageSource addTarget:lookupFilter];
    [lookupImageSource addTarget:lookupFilter];

    [stillImageSource processImage];
    [lookupImageSource processImage];
    UIImage *adjustedImage = [lookupFilter imageFromCurrentlyProcessedOutput];

    return adjustedImage;
}


来源:https://stackoverflow.com/questions/19169043/color-specific-hue-saturation-from-photoshop-to-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!