gpt4 book ai didi

iphone - 从 Photoshop 到 iOS 的颜色特定色相/饱和度

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:10:31 28 4
gpt4 key购买 nike

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

有谁知道如何在 iOS 中操作 CIFilter 或 GPUImage 类来获得下面的 photoshop 效果?

enter image description here

最佳答案

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

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 文件中的所有颜色滤镜,保存它,然后应用滤镜:

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

关于iphone - 从 Photoshop 到 iOS 的颜色特定色相/饱和度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19169043/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com