It is currently Wed Aug 19, 2026 3:50 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: My filter like "illustration" or "cartoon"
PostPosted: Mon Oct 13, 2014 10:42 am  (#1) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
My custom filter first try.
Based on pendraw.

# -- v 2.1
#@gimp Mc_Pendraw : mc_pendraw, mc_pendraw_preview
#@gimp : Sep = separator()
#@gimp : Amplitude = float(8,0,30)
#@gimp : Blur = float(0.8,0.1,2)
#@gimp : Sharp = float(450,100,2000)
#@gimp : Color = int(21,4,256)
#@gimp : Dithering = float(0.5,0,1)
#@gimp : Value = float(1,0,1)
#@gimp : Mode 2 = bool(false)
#@gimp : Color equal. = bool(false)
#@gimp : Equal. limit = int(255,100,255)
#@gimp : Sep = separator()
#@gimp : Lowers contrast = float(0,0,1)
#@gimp : Sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate horizontal","Duplicate vertical")

mc_pendraw:
  -repeat @# -l[$>]
  -split_opacity
  -l[0]
  -to_rgb
  # contrast mask
  -if {$10>0}
      [0]
      -b[0] 1
      -negative[0]
      -luminance[0]
      -rv[0,1]
      -blend[0,1] overlay,$10
  -endif
  # pendraw
  --gimp_gradient_norm[0] 0,1.5,0,50.38,1,0
  [0]
  -smooth $1,0.2,1,3,3
  -b $2
  -sharpen $3
  [0]
  -r[0] 20,20,1,3,2
  -equalize[0]
  -index[3] [0],1,1
  -rm[0]
  # --
  -nm[0] linee
  -nm[1] orig
  -nm[2] pen
  -if {$7==0}
      -rv[pen,linee]
      -blend[pen,linee] multiply,1
  -elif {$7==1}
      -rv[orig,linee]
      -blend[orig,linee] multiply,1
  -endif
  -normalize[0] 5,250
  -autoindex[0] $4,$5
  -rv[0,1]
  -blend[0,1] value,1
  -if {$8==1}
    -equalize 21,30,$9
  -endif
  -endl -a c -endl -done

mc_pendraw_preview:
  -gimp_split_preview "-mc_pendraw $*",$-1
# ---


Attachments:
filter.jpg
filter.jpg [ 77.02 KiB | Viewed 2760 times ]
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: My filter like "illustration" or "cartoon"
PostPosted: Mon Oct 13, 2014 2:25 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Thanks, I've added it to 'Testing / Telperion /'

Attachment:
gmic_mcpendraw.png
gmic_mcpendraw.png [ 210.72 KiB | Viewed 2694 times ]


Top
 Post subject: Re: My filter like "illustration" or "cartoon"
PostPosted: Mon Oct 13, 2014 2:44 pm  (#3) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
thanks a lot Ronounours.

A tip:
with images with white or very light background,
there may be poor results.
in gimp use: select-by-color threshold 20% and pick a white point
then invert selection and apply the filter.

I'm trying to solve the selection within the filter.


Top
 Post subject: UPDATE v.2.2
PostPosted: Tue Oct 14, 2014 6:14 am  (#4) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
# ---------------------------------- v 2.2

#@gimp Mc_Pendraw : mc_pendraw, mc_pendraw_preview
#@gimp : Sep = separator()
#@gimp : Amplitude = float(8,0,30)
#@gimp : Blur = float(0.8,0.1,2)
#@gimp : Sharp = float(450,100,2000)
#@gimp : Color = int(21,4,256)
#@gimp : Dithering = float(0.5,0,1)
#@gimp : Value = float(1,0,1)
#@gimp : Mode 2 = bool(false)
#@gimp : Color equal. = bool(false)
#@gimp : Equal. limit = int(255,100,255)
#@gimp : Sep = separator()
#@gimp : Lowers contrast = float(0,0,1)
#@gimp : Sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate horizontal","Duplicate vertical")

mc_pendraw:
  -repeat @# -l[$>]
  -split_opacity
  -l[0]
  -to_rgb
  # contrast mask
  -if {$10>0}
      [0]
      -b[0] 1
      -negative[0]
      -luminance[0]
      -rv[0,1]
      -blend[0,1] overlay,$10
  -endif
  # pendraw
  --gimp_gradient_norm[0] 0,1.5,0,50.38,1,0
  [0]
  -smooth $1,0.2,1,3,3
  -b $2
  -sharpen $3
  [0]
  -r[0] 20,20,1,3,2
  -equalize[0] 256,0%,98%
  -index[3] [0],1,1
  -rm[0]
  # --
  -nm[0] linee
  -nm[1] orig
  -nm[2] pen
  -if {$7==0}
      -rv[pen,linee]
      -blend[pen,linee] multiply,1
  -elif {$7==1}
      -rv[orig,linee]
      -blend[orig,linee] multiply,1
  -endif
  -normalize[0] 5,250
  -autoindex[0] $4,$5
  -rv[0,1]
  -blend[0,1] value,$6
  -if {$8==1}
    -equalize 21,30,$9
  -endif
  -endl -a c -endl -done

mc_pendraw_preview:
  -gimp_split_preview "-mc_pendraw $*",$-1


# ----------------------------------------------------------------------


connected the value slider $6,
and -equalize[0] 256,0%,98% to fix possible problems with large white areas in the picture.


Top
 Post subject: Re: My filter like "illustration" or "cartoon"
PostPosted: Tue Oct 14, 2014 9:47 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Thanks, it has been updated.


Top
 Post subject: Re: My filter like "illustration" or "cartoon"
PostPosted: Mon Sep 07, 2015 5:34 am  (#6) 
Offline
GimpChat Member

Joined: Oct 11, 2014
Posts: 82
update with new
-repeat $! -l[$>]

# ---------------------------------- v 2.3

#@gimp Mc_Pendraw : mc_pendraw, mc_pendraw_preview
#@gimp : Sep = separator()
#@gimp : Amplitude = float(8,0,30)
#@gimp : Blur = float(0.8,0.1,2)
#@gimp : Sharp = float(450,100,2000)
#@gimp : Color = int(21,4,256)
#@gimp : Dithering = float(0.5,0,1)
#@gimp : Value = float(1,0,1)
#@gimp : Mode 2 = bool(false)
#@gimp : Color equal. = bool(false)
#@gimp : Equal. limit = int(255,100,255)
#@gimp : Sep = separator()
#@gimp : Lowers contrast = float(0,0,1)
#@gimp : Sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate horizontal","Duplicate vertical")
#@gimp : Sep = separator() ,note = note("Apply an illustration/cartoon effect. v.2.3")

mc_pendraw:
  -repeat $! -l[$>]
  -l[0]
  -tic
  -to_rgb
  # contrast mask
  -if {$10>0}
      [0]
      -b[1] 1
      -negative[1]
      -luminance[1]
      -blend[0,1] overlay,$10
  -endif
  # pendraw
  --gimp_gradient_norm[0] 0,1.5,0,50.38,1,0
  [0]
  -smooth $1,0.2,1,3,3
  -b $2
  -sharpen $3
  [0]
  -r[0] 20,20,1,3,2
  -equalize[0] 256,0%,98%
  -index[3] [0],1,1
  -rm[0]
  # --
  -nm[0] linee
  -nm[1] orig
  -nm[2] pen
  -if {$7==0}
      -rv[pen,linee]
      -blend[pen,linee] multiply,1
  -elif {$7==1}
      -rv[orig,linee]
      -blend[orig,linee] multiply,1
  -endif
  -normalize[0] 5,250
  -autoindex[0] $4,$5
  -rv[0,1]
  -blend[0,1] value,$6
  -if {$8==1}
    -equalize 21,30,$9
  -endif
  -toc
  -endl -a c -endl -done

mc_pendraw_preview:
  -gimp_split_preview "-mc_pendraw $*",$-1


# ----------------------------------------------------------------------


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group