1

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.

Community
  • 1
  • 1
weso
  • 189
  • 3
  • 14

1 Answers1

0

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.

Mike Mertsock
  • 11,825
  • 7
  • 42
  • 75
Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
  • 1
    Also note that he added that image after I left my answer. GPUImage can't do the image he inserted into his question. His image is showing a stylistic conversion of a raster image into a vector one, which is a fairly complex operation. You probably aren't going to find a performant implementation of that on iOS, especially not for free. – Brad Larson Sep 03 '13 at 22:14