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

Almost makes me want to join the two scripts, they work so well together. A great compliment.

It all depends on how granular you want to get with the half-tone effect. If you want to force a halftone on the image with no input other than a check box then it would be easy. If you want to duplicate the newsprint dialog then it would make more sense to just apply the newsprint after the effect is rendered, i.e.; let the end user run another filter..
What I have seen on other filters for the halftone, is after the image is flattened, just a call to plug-in-newsprint with predefined parameters.

Here's an example of what I mean....

(gimp-image-flatten img)

(set! layer-temp1 (car (gimp-image-get-active-layer img)))

(plug-in-newsprint 1 img layer-temp1 3 0 0 0 0 15 0 75 0 0 0 2)

this will blanket the image by default.

if you want a check box then add another parameter in the register section,
SF-TOGGLE _"Halftone" FALSE

the define section,
halftone
then an if statement before the plug-in-newsprint.
(if (= halftone TRUE)
(plug-in-newsprint 1 img layer-temp1 3 0 0 0 0 15 0 75 0 0 0 2))

Could you explain the corresponding manual steps ?

Here's a link to the effect doing it manually. http://www.youtube.com/watch?v=xy-JwyXEREI. It covers off all of the steps, it does not use the GREYCstoration plug-in filter, the levels are different, but the effect is the same. The final step (to reduce the number of colors) is to change the image mode to indexed with 16 colors, then change it back to RGB. Hope this helps.

Hello, this filter seems really interesting, but I'm not able to use it.
A lot of new black layers were created and then I received this message: Plug-In 'CarTOONize' left image undo in inconsistent state, closing open undo groups.

I tried with gimp 2.6.8 and 2.6.11 under windows XP and with 2.6.8 under linux. Same result.

Did I wrong something?

Bye

Sounds like you don't have the GREYCstoration plug-in. Un-check the Prefilter option and try it again. If that works, then edit the "CarTOONize.scm", in the register section at the bottom of the file, change the line: SF-TOGGLE _"Prefilter *(Surface Blur-GREYCstoration Filter Required)" TRUE to SF-TOGGLE _"Prefilter *(Surface Blur-GREYCstoration Filter Required)" FALSE Save the file. The option will now default to unchecked when you run the filter.

You can check if the plugin is installed in code:

(if (defined? 'plug-in-shift) (gimp-message "It Exists") (gimp-message "Doesnt Exist"))

so in your case you could do

(if (defined? 'plug-in-greycstoration)
(plug-in-greycstoration 1 img drawable 60 .70 1 .6 1.1 .8 30 2 0 0 4 10 15 7 1 2)
(gimp-message "GREYCstoration must be installed to prefilter!")
)

in place of the direct call.

-Rob A>

Rob A > I was thinking of doing that, but it would only generate more questions about how to install an old plug-in that no longer exists. The newer G'MIC has the same effect, but then again they would need the G'MIC installed. (and the documentation of using the G'MIC in script-fu is sparse at best).
That's why I decided to give the option to enable or disable the plug-in. Anybody can modify thier version of the script using Rob's suggestion.

Have added the G'MIC support, as well as the original GREYCstoration non error report. As a bonus, added the halftone effect as well. Try it out..

Pages

Subscribe to Comments for "CarTOONize"