Skip to content

Is it possible to use a custom CIFilter with an ImageRequest? #758

@adamvnovak

Description

@adamvnovak

I use a custom LUT filter like so:

let lutFilter = colorCubeFilterFromLUT(imageName: "K64LUT")
lutFilter!.setValue(incrementallyFilteredImage, forKey: kCIInputImageKey)
incrementallyFilteredImage = lutFilter?.outputImage

But it seems like the processors on ImageRequest don't allow you to pass a filter in, you can only identify existing filters.

return ImageRequest(url: url, 
            processors: [
                ImageProcessors.Resize(width: 500),
                ImageProcessors.CoreImageFilter.init(name: <#T##String#>, parameters: <#T##[String : Any]#>, identifier: <#T##String#>)
            ]
)

Is it not possible to cache an image with a custom CIFilter as of now?

What could be a workaround? Should I cache the load the image using ImagePipeline, then immediately apply my custom filter, and then override the saved data in the cache? I would like instant access to the image with the filter later on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementNon-functional change that improves existing functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions