You are here

CarTOONize

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
AttachmentSize
CarTOONize.scm Version 1.0.710.63 KB

CarTOONize your pictures using a script-fu script. Script has controls for adjusting the line thickness, as well as the 'black' shadows. Now you can adjust the number of color levels from 1 to 5 (the default is 4), 1 being very flat, 5 adding more color levels. Can enable/disable the black shadows, as well as a pre-filter * (It uses the GREYCstoration, G'MIC, Selective Gaussian, or Despeckle filter as a 'surface blur' to eliminate noise, which is user selectable). You can now either overwrite existing or generate a new layer.

This filter is not the same as the Cartoon filter included with GIMP. It will actually generate a cartoon version of your picture in a few seconds. If you leave the defaults, you can get some decent results. It will keep the same skin colors as the original picture, but it will be flattened, with lowlights, and highlights. here's a few before and after pics.

http://joe1gk.blogspot.combefore http://joe1gk.blogspot.comafterhttp://joe1gk.blogspot.comV.1.0.6

http://joe1gk.blogspot.combefore http://joe1gk.blogspot.comafter http://joe1gk.blogspot.comV.1.0.6

http://joe1gk.blogspot.combefore http://joe1gk.blogspot.comafter http://joe1gk.blogspot.comV.1.0.6

Version 1.0.7 Color Levels gif showing different levels:

http://joe1gk.blogspot.com

Code License: 
GIMP Version: 
Scripting Engine: 

Comments

If you want to provide SOME prefiltering to those without gmic or greycstoration, I'd suggest the often underused selective gaussian blur with the following code after your other two prefilter checks:


(if (= Prefilter TRUE)
(if (= isfiltered FALSE)
(begin
(plug-in-sel-gauss 1 img layer-gmic 5 15)
(set! isfiltered TRUE)
)
)
)

-Rob A>

The Despeckle plug-in might also be a good fallback. The GEGL bilinear filter would be another good alternative but I don't think GEGL operations are currently exposed in the Procedural DataBase (if they are, please let me know).

@Rob A, you might consider using the "pre" HTML tag when posting code on GPR so as to retain formatting.

(if (= Prefilter TRUE)
  (if (= isfiltered FALSE)
    (begin
      (plug-in-despeckle 1 img layer-gmic 5 1 -1 256)
      (set! isfiltered TRUE)
      )
    )
  )

Good point -- I'll call it the last resort.

Did more testing, 5 15 was starting to remove some of the edge detail, I reduced the values to 4 11 after much testing with the parameters.

The results are not as good as the G'MIC or GREYCstoration, but it does reduce a lot of noise.

Thanks again for the input.

Subject says it all. I know on my scripts I like to get constructive feedback and improvement suggestions.

-Rob A>

In order to get the prefiltering to work, I had to change line 68 and 70 to:
(if (defined? 'plug-in-GREYCstoration)
and
(plug-in-GREYCstoration 1 img layer-gmic 60 .70 1 .6 1.1 .8 30 2 0 0 4 10 15 7 1 2)

Great Job, Joe1GK! I like it.

Version 2 works fine.
Thank you.

Excellent Joe. Mahvin at GIMPChat gave me a heads up on this one. Thanks for sharing. One of the best of this type that I've seen thus far. Caption's that of my brother and my 2 nephews. :)

Thanks for the kind words and example(s).

Pages

Subscribe to Comments for "CarTOONize"