【问题标题】:Color Specific Hue/Saturation from Photoshop to iOS从 Photoshop 到 iOS 的颜色特定色相/饱和度
【发布时间】:2013-10-10 17:35:27
【问题描述】:

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

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

【问题讨论】:

  • 您的意思是您要查找颜色的 RGB 值吗?在 HTML 表示法中,它似乎是 2d7878(对于大多数 iOS 用途,大致为 R:0.176 G:0.471 B:0.471)
  • 这一层改变照片中的红色,只为红色调整色调、饱和度和亮度。
  • @Eric 你有没有做到这一点?有没有办法在 GPUImage 类中使用从 photoshop 导出的 .ahu 文件?

标签: iphone ios core-image gpuimage cifilter


【解决方案1】:

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

GPUImageLookupFilter:使用 RGB 颜色查找图像重新映射 图像中的颜色。首先,使用您喜欢的照片编辑 将过滤器应用于lookup.png的应用程序 GPUImage/框架/资源。为了使每个像素都能正常工作 颜色不能依赖于其他像素(例如模糊不起作用)。如果 您需要一个更复杂的过滤器,您可以创建尽可能多的查找表 必需的。准备好后,使用新的 lookup.png 文件作为第二个输入 用于 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;
}

【讨论】:

    猜你喜欢
    • 2021-11-16
    • 1970-01-01
    • 1970-01-01
    • 2016-09-25
    • 2011-05-23
    • 2011-05-17
    • 2012-03-15
    • 2023-03-25
    • 1970-01-01
    相关资源
    最近更新 更多