Closed alyfreym closed 5 years ago
Result
We do not currently support this kind of color lookup table.
The supported CLUT types are:
BTW, here's a tool we use to generate identity color lookup tables. https://github.com/YuAo/IdentityCLUTImageGenerator
Is it possible to convert it into 2D square format?
Yes, you can just re-apply the effect to a 2d square identity color lookup table image.
BTW, you do not need to do unpremultiplyingAlpha()
. The color lookup table is an opaque image you can pass the isOpaque: true
to the initializer: MTIImage(cgImage: UIImage(named: "ColorLookup512")!.cgImage!, options: [.SRGB: false], isOpaque: true)
. This saves a render pass for you.
Thank you, I did it.
Hi, I'm trying to use MTIColorLookupFilter, but the result is wrong, can you tell me what's wrong? I uploaded Color Lookup Table image.
let cg = UIImage(named: "lookup")!.cgImage! let filter = MTIColorLookupFilter() filter.inputColorLookupTable = MTIImage(cgImage: cg, options: [MTKTextureLoader.Option.SRGB : true]).unpremultiplyingAlpha() filter.inputImage = inputImage