Search code examples
iosgpuimage

GPUImage Cartoon Filter parameters


Does anybody know right parameters to use with GPUImageFilter to make an effect like this?

To Convert Image to Cartoon in ios

I found many answer but the "multiple filter" applied doesn't work like I want.


Solution

  • As described in the read me for GPUImage https://github.com/BradLarson/GPUImage the cartoon filter takes the following parameters:

    texelWidth:

    texelHeight: These parameters affect the visibility of the detected edges

    threshold: The sensitivity of the edge detection, with lower values being more sensitive. Ranges from 0.0 to 1.0, with 0.2 as the default

    quantizationLevels: The number of color levels to represent in the final image. Default is 10.0

    As for the exact levels required, you'll need to play around with that yourself and determine what best fits your need. There is no one size fits all solution to just turn any image into a cartoon, especially at the level of detail in the photo in that question.