It is currently Mon Jul 08, 2024 5:41 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Wed Dec 29, 2021 2:09 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 06, 2020
Posts: 348
Location: The Netherlands
If you have G'mic then you can get this result at Artistic> Comic book.


Attachments:
comic book.png
comic book.png [ 62.64 KiB | Viewed 1811 times ]
Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Wed Dec 29, 2021 5:55 am  (#12) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2439
A fix for the more obvious syntax changes, script attached. Originally for Gimp 2.4

What does not work? gimpressionist - maybe someone can find out why. Even the script says
Tip: If you do not have a good Gimpressionist preset, simply hit cancel at the Gimpressionist dialog window, and you will still get a good greyscale line-art." So best way is just disable that option.

No doubt it can be broken in use, but a quick demo. https://i.imgur.com/6l9uADh.mp4

...but as pointed out, there are plenty of other options.


Attachments:
lasm-line-art-updt.scm [20.49 KiB]
Downloaded 67 times

_________________
Image
Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Wed Dec 29, 2021 6:06 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12713
Location: Spain, Aragón
I post my way if someone is interested in it. :paint


Attachments:
Photo_To_Art_Line by Issa.pdf [1.41 MiB]
Downloaded 96 times
B&W_Art_Line_Result.jpg
B&W_Art_Line_Result.jpg [ 285.16 KiB | Viewed 1787 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Wed Dec 29, 2021 8:49 am  (#14) 
Offline
GimpChat Member

Joined: Dec 19, 2018
Posts: 158
Just indicating another option among the many available:

Tim Tran's Plugin - Picture To Liene Art
Plugin Picture To Line Art
https://gimplearn.net/viewtopic.php?p=3522#p3522

It has worked on all the latest versions of Gimp I've used and even on this current one 2.10.28


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Wed Dec 29, 2021 1:42 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jul 06, 2013
Posts: 2607
Location: California
rich2005 wrote:
A fix for the more obvious syntax changes, script attached. Originally for Gimp 2.4

What does not work? gimpressionist - maybe someone can find out why. Even the script says
Tip: If you do not have a good Gimpressionist preset, simply hit cancel at the Gimpressionist dialog window, and you will still get a good greyscale line-art." So best way is just disable that option.

No doubt it can be broken in use, but a quick demo. https://i.imgur.com/6l9uADh.mp4

...but as pointed out, there are plenty of other options.


I downloaded the updated version but it doesn't show up in FX Foundry-->Artistic or in Script-Fu->Lasm's FX Effects->Line Art as the script states when looking into the code. I'm using gimp 2.10.30 on windows 10 64 bit.


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Dec 30, 2021 11:19 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: Aug 27, 2021
Posts: 13
Location: Chesterfield, UK
If it is not necessary to strictly keep to line only: allowing representation of tonal values for example by stippling, there are more options, this being a good retro one:
https://wiki.evilmadscientist.com/Produ ... _with_Gimp

and more to be found by searching on this site and wider

it is difficult to match drawing for line, even with artificial intelligence, occasionally something original and better than a drawing or a good inspiration for a drawing can be created using digital photo manipulation

I am a believer in if you can write you can draw or if you can talk you can sing but most people haven't got the time for the learning curve, often because they are busy helping other people

for me Matisse, Picasso and Japanese sumi-e set the bar high


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Dec 30, 2021 4:52 pm  (#17) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Hello! :)
Here is yet another way:
  • Filters -> G'Mic -> Artistic -> Comic Book
  • Filters -> G'Mic -> Various -> Custom Code [Global]
    and paste
    fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50
    otsu. 4 n. 0,255

Here are examples:
Attachment:
giraffe_photo_small_lineArt2.jpg
giraffe_photo_small_lineArt2.jpg [ 78.58 KiB | Viewed 1689 times ]

Attachment:
wolf_on_ridge_small_lineArt2.jpg
wolf_on_ridge_small_lineArt2.jpg [ 66.45 KiB | Viewed 1689 times ]

Attachment:
kitten_white_sitting_small_lineArt2.jpg
kitten_white_sitting_small_lineArt2.jpg [ 72.76 KiB | Viewed 1689 times ]

Hope this helps!

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Fri Dec 31, 2021 11:02 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12713
Location: Spain, Aragón
Thank you so much cli345; it works great! :coolthup


Attachments:
87383dd1bee11c1bb_Art_Line_by cli345's code.jpg
87383dd1bee11c1bb_Art_Line_by cli345's code.jpg [ 160.38 KiB | Viewed 1657 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Sat Jan 08, 2022 2:57 pm  (#19) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Happy to help and thanks also for your way! :)

Here is yet another way:
  • Filters -> G'Mic -> Artistic -> Comic Book
  • Filters -> G'Mic -> Various -> Custom Code [Global]
    and paste
    if s==4 split_opacity. rm. fi
    +colormap. 8
    index.. [-1],0,1
    rm.
    rgb2hsl. split. c
    n. 0,1
    append c hsl2rgb
    fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50
    fx_curves_interactive. 7,0,1,"7","0,0,20,80,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1"

Here are examples:
Attachment:
examplesLineArt.jpg
examplesLineArt.jpg [ 199.41 KiB | Viewed 1583 times ]

Hope this helps!

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Sun Jan 09, 2022 3:34 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12713
Location: Spain, Aragón
cli345, thanks again. Yes, the second code helps a lot. I see the lines being thinner with a nice result. :coolthup :tyspin


Attachments:
Original_Art_Line_2nd_code.jpg
Original_Art_Line_2nd_code.jpg [ 291.58 KiB | Viewed 1558 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Mon Apr 04, 2022 11:19 am  (#21) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Hello! :)

I intend to propose a new dedicated G'Mic filter "Line Art".
With default parameters, it would give these results:
Attachment:
lineArtExamples2.jpg
lineArtExamples2.jpg [ 169.15 KiB | Viewed 1508 times ]

With "type=Gray Patches", it would give:
Attachment:
lineArtExamples.jpg
lineArtExamples.jpg [ 159.52 KiB | Viewed 1508 times ]

Here is its code:
#@gui ____<b>Artistic</b>
#------------------

#@gui Line Art (prerelease): cl_lineart_prerelease, cl_lineart_prerelease_preview(0)
#@gui : note = note("<b>Photo to Line Art</b>")
#@gui : sep = separator()
#@gui : note = note(" ")
#@gui : Local Contrast Enhancement = int(0,0,4)
#@gui : sep = separator()
#@gui : note = note("<b>For edges:</b>")
#@gui : Flattening for Edge (bilateral) = int(2,0,5)
#@gui : Line Thickness = float(1,0.5,2)
#@gui : Line Strength = float(15,0,19)
#@gui : sep = separator()
#@gui : Add Black or Gray = bool(1)
#@gui : note = note("<b>For black and grays:</b>")
#@gui : Luminosity Increase = int(0,0,40)
#@gui : Final Flattening (bilateral) = int(6,0,10)
#@gui : Lines Antialias = int(15,0,100)
#@gui : Type = choice(2, "Soft Threshold", "Gray Patches", "Lines and Black", "Black and Lines")
#@gui : sep = separator()
#@gui : Final Antialias = choice(2, "None", "Light Simple", "Simple", "Very Strong")
#@gui : sep = separator()
#@gui : Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal",
#@gui : "Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right",
#@gui : "Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse")
#@gui : Preview Split = point(50,50,0,0,200,200,200,0,10)_0
#@gui : sep = separator()
#@gui : url = link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=15&t=5328&start=10#p270912")
#@gui : note = note("<small>Author: <i>Claude Lion</i>.      Latest Update: <i>2022/04/03</i>.</small>")
#@gui : note = note("<small>It uses filters of David Tschumperlé and a few filters of Jérôme Boulanger.</small>")
#@gui : note = note("<small>Type='Lines and Black' is a shortcut of 'Black and Lines' with 'Local Contrast Enhancement = 1' and 'Luminosity Increase = 40'. In this case, 'Local Contrast Enhancement' and 'Luminosity Increase' cursors have no effect.</small>")

cl_lineart_prerelease:
   locContEnh=$1
   nbBilatBord=$2
   lineThick=$3
   forceTrait=$4
   addGrays=$5
   augmLum=$6
   nbBilatFin=$7
   antialias=$8
   type=$9
   finalAntialias=$10

   repeat $! l[$>]

      if $type==2
         locContEnh=1
         augmLum=40
      fi
      
      fx_LCE. 80,{$locContEnh/2},1,1,0,0
      
      curv="0,0,"{50-$augmLum}","{50+$augmLum}",100,100,-1,0,0,30,70,100,100,-1,0,0,100,100,-1,0,0,100,100,-1"
      +fx_curves_interactive.  7,0,1,"7",$curv
      fx_smooth_nlmeans.. 4,4,10,5,0,0,24,0
      fx_smooth_bilateral.. 10,7,$nbBilatBord,0,0

      +cut.. 0,255
      reverse[-2,-1]
      blur[-3] {$lineThick}
      sub[-3,-2]

      fill.. "M = max(R,G,B); [M, M, M]"

      cut.. 0,255 n.. 0,255
      negate..
      threshold.. {$forceTrait+80}%
      n.. 0,255

      fx_smooth_antialias.. $antialias,0,1,0,50,50

      if $addGrays==1
         mul[-2,-1]
         n. 0,255
         fx_smooth_bilateral. 10,7,$nbBilatFin,0,0
         
         
         if $type==0
            fx_curves_interactive. 7,0,1,"7","0,0,60,0,80,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1"
         elif $type==1
            if s==2 split_opacity. rm. fi
            +colormap. 8
            index.. [-1],0,1
            rm.
            rgb2hsl. split. c
            n. 0,1
            append c hsl2rgb
            fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50
            fx_curves_interactive. 7,0,1,"7","0,0,20,80,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1"
         elif $type>=2
            fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50
            otsu 4
            n 0,255
         fi
      else
         remove[-1]
      fi
      
      if $finalAntialias==1
         fx_smooth_antialias. 15,0,1,0,50,50
      elif $finalAntialias==2
         fx_smooth_antialias. 15,0,1,0,50,50
         fx_smooth_antialias. 50,50,2.5,0,50,50
         #gcd_despeckle 50,1
         #fx_smooth_antialias. 15,20,1,0,50,50
         #fx_smooth_antialias 100,50,1,0,50,50
         #fx_smooth_antialias 100,50,5,0,50,50
         #gcd_despeckle 50,1
      elif $finalAntialias==3
         fx_smooth_antialias. 100,0.5,5,0,50,50
         fx_smooth_antialias. 100,0.5,5,0,50,50
      fi

   endl done

cl_lineart_prerelease_preview:
   gui_split_preview "cl_lineart_prerelease $*",${-3--1}

Installation:
  • Copy and paste the above code into the file "~/.gmic" on Linux or the file "%APPDATA%\user.gmic" on Windows.
  • The new filter appears in "Filters -> G'MIC -> Artistic -> Line Art (prerelease)".

Have fun! :)

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Tue Apr 05, 2022 4:02 am  (#22) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2439
Very nice effect, works fine with gmic version 3.0.2 but this error with 3.1.0

*** Error in ./cl_lineart_prerelease/*repeat/*local/ *** Unknown command or filename 'endl'; did you mean 'and'?

More changes in gmic syntax, David has been fixing existing filters, additional work for you ;)

_________________
Image


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Wed Apr 06, 2022 2:35 pm  (#23) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Thanks, rich2005! :)
I think I'll have to replace "endl done" by "done done".

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Apr 07, 2022 4:41 am  (#24) 
Offline
GimpChat Member
User avatar

Joined: Feb 12, 2021
Posts: 18
Thanks Claude!
Now added to G'MIC 3.1.0_pre.
Added a news about it on the Twitter account: https://twitter.com/gmic_eu/status/1512002150343319554


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Apr 07, 2022 6:32 am  (#25) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Excellent filter, Claude !

_________________
"Where am I ?"


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Apr 07, 2022 10:20 am  (#26) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2439
@dtschump

This using kubuntu 20.04 / Gimp 2.10.30 / gmic 3.1.0 and updated (shows 576 filters)

*** Error in ./cl_lineart/*foreach/fx_curves_interactive/ *** Unknown command or filename '=>'; did you mean '='?

Ooops, needed to update the plugin file as well, works now using 3.1.0_pre#220406

_________________
Image


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Apr 07, 2022 5:49 pm  (#27) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
Love the effect of this filter, Claude. Thanks for it.

Attachment:
Bike-lineart.jpg
Bike-lineart.jpg [ 329.8 KiB | Viewed 1379 times ]


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Apr 07, 2022 10:19 pm  (#28) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 7747
Location: On the other side of this screen
cool :)

_________________


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Thu Feb 02, 2023 2:45 pm  (#29) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Hello! :)

Thanks to Miguel Pineau for the video (in French)! :tyspin

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Convert Color Photo to Line Art (Plug-in or instructions)
PostPosted: Sat Feb 11, 2023 9:28 am  (#30) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
ref: https://images.pexels.com/photos/400346 ... 750&w=1260

Sorry for the belated reply; meant to do so a week ago but got busy. lol

Anyway, one of my favorite ways to create line art is G'MIC's Engrave preset. Of course I added some secret pre and post processing to the mix (it's what I do). :)


Attachments:
Elephant Engraved.jpg
Elephant Engraved.jpg [ 1.44 MiB | Viewed 1018 times ]

_________________
Lyle

Psalm 109:8

Image
Top
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Calling GIMP Plug-in From Command Line - on Windows

0

No new posts Attachment(s) How to restore the photo with more black color

23

No new posts Attachment(s) How to restore color and increase sharpness on old photo

0

No new posts Attachment(s) convert a gbr bristles to abr

2

No new posts Attachment(s) GEGL Color Light Fusion (12 blend modes for color overlay)

9



* Login  



Powered by phpBB3 © phpBB Group