You are here


  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
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:

Code License: 
GIMP Version: 
Scripting Engine: 


Even more excellent news. Again, thankyou Joe. :)

This is a really nice filter. There are two suggestions I would make. (EDIT: Actually, three. See P.S. below.)

First, scripts should generally employ named buffers when they perform COPY&PASTE, leaving the user's clipboard intact. This is especially so now that the clipboard can be used as a pattern or brush.

Second, it would be nice if the script worked only on the active layer, leaving the rest of the image unmodified. This is not exactly a trivial change, but it's not terribly difficult either. Because it's not possible to quantize an individual layer to Indexed mode (only the entire image), it will be necessary to copy the layer to a separate image for, at least, that step.

You may as well create this separate image from the start and perform all of your steps on this separate image (thus being able to do image flattening when convenient instead of merging individual layers, in addition to the Indexing step). When you are done, merely copy the resulting layer back to the original layer.

(set! buffer (car (gimp-edit-named-copy drawable)))
(set! toon-img (car (gimp-edit-named-paste-as-new buffer)))
(gimp-image-undo-disable toon-img)
: Do all your stuff HERE on "toon-img"!
(set! buffer (car (gimp-edit-named-copy 
                      (car (gimp-image-get-active-drawable toon-img)) )
    (car (gimp-edit-named-paste drawable 
                                FALSE )) )

P.S. It is convention to append ellipses to your menu command if the command presents a dialog.

I agree with you on the layer thing...and yet he hasn't done it!!! it is 2012 and your comment is 2010!!! I agree with you 100% that is should be able to be done to a layer!!!

Added selection option for pre-filter. Defaults to selective gaussian blur. If both GREYCstoration and G'MIC are installed you can now choose which one to use. Message will now pop up if the selected filter is not installed, stating that no prefilter was applied.


You did an outstanding job on this script, Joe. Give yourself a few pats on the back.

Haven't downloaded your current version yet (1.0.4 that is), but with 1.0.3, if you have both GREYCStoration and G'MIC, it defaults to using GREYCStoration (ended up commenting out the GREYCStoration part of the code). I wonder how hard it would be to have the utility ask what method of smoothing. I actually prefer G'MIC since GREYC is not so much supported anymore. It may be more quicker to use strait Selective G so sometimes folk may trade quality for speed. Just adding this request. :)

Here you go.

Excellent. Thankyou Joe. :)

Added last-resort pre-filter as per Rob A> comment. Changed his suggested values of 5 / 15 to 4 / 11, as there was some loss in the line (edge) detail at the higher values.

Now has similar half-tone effect to the comic-strip version.

Revised the layer issue with the same name.



Subscribe to Comments for "CarTOONize"