从Photoshop到iOS的颜色特定的色相/饱和度 [英] Color Specific Hue/Saturation from Photoshop to iOS

查看:115
本文介绍了从Photoshop到iOS的颜色特定的色相/饱和度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用GPUImage和CIFilter映射此过滤器。请注意,我需要帮助将特定颜色(红色)(注意:不是主色,只是红色)的photoshop元素映射到iOS。

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.

有人知道如何操纵CIFilter吗?或GPUImage类在iOS中获得以下Photoshop效果?

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

推荐答案

您可以将GPUImage与查找过滤器一起使用:

You could use GPUImage with the lookup filter:


GPUImageLookupFilter:使用RGB颜色查找图像重新映射图像中的
颜色。首先,使用您喜欢的照片编辑
应用程序将滤镜从
GPUImage / framework / Resources应用于lookup.png。为了使其正常工作,每个像素
的颜色不得依赖于其他像素(例如,模糊将不起作用)。如果
您需要更复杂的过滤器,则可以创建所需
一样多的查找表。准备就绪后,将新的lookup.png文件用作GPUImageLookupFilter的第二个输入

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.

因此,在在Photoshop中将GPUImage中的lookup.png文件保存起来,然后应用滤镜:

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;
}

这篇关于从Photoshop到iOS的颜色特定的色相/饱和度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆