It is currently Thu Apr 25, 2024 6:41 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 03, 2022 11:44 am  (#1) 
Offline
GimpChat Member

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

I intend to propose a new G'MIC filter "Frame [Relief]".
With default parameters, it would give these results:
Attachment:
examples_reliefFrame.jpg
examples_reliefFrame.jpg [ 122.05 KiB | Viewed 1673 times ]
With default parameters except that "Type = Groove, Kaleidoscope unchecked, Frame Blur = 5, Frame Hue Change = 180, Graininess Amount = 7", it would give:
Attachment:
examples_reliefFrame2.jpg
examples_reliefFrame2.jpg [ 169.62 KiB | Viewed 1673 times ]
With default parameters except that "Type = Outset, Relief Amount = 50, Kaleidoscope unchecked, Frame Blur = 10, Frame Saturation Change = -1, Graininess Amount = 7", it would give:
Attachment:
examples_reliefFrame4.jpg
examples_reliefFrame4.jpg [ 161.8 KiB | Viewed 1673 times ]

Here is its code:
#@gui ____<b>Frames</b>
#------------------
#@gui Frame [Relief] (prerelease): cl_reliefFrame_prerelease, cl_reliefFrame_prerelease(1)
#@gui : note = note("<b>Frame Limit:</b>")
#@gui : Type = choice(1, "Outset", "Inset", "Groove", "Ridge")
#@gui : Size = float(10,6,20)
#@gui : Relief Width = float(1.5,0,10)
#@gui : Relief Amount = float(75,0,127)
#@gui : sep = separator()
#@gui : note = note("<b>Frame Area:</b>")
#@gui : Kaleidoscope Effect = bool(1)
#@gui : Frame Blur = float(60,5,80)
#@gui : Frame Hue Change = float(0,-180,180)
#@gui : Frame Saturation Change = float(0,-1,1)
#@gui : Frame Luminosity Change = float(0,-0.5,0.5)
#@gui : sep = separator()
#@gui : note = note("<b>Graininess:</b>")
#@gui : Graininess Type = choice("Gaussian", "Uniform", "Poisson")
#@gui : Graininess Amount = float(0,0,80)
#@gui : sep = separator()
#@gui : note = note("<small>Author: <i>Claude Lion</i>.      Latest Update: <i>2022/07/01</i>.</small>")
#@gui : note = note("<small>It uses filters of David Tschumperlé.</small>")

cl_reliefFrame_prerelease:
   
   frameType,frameSize,reliefWidth,reliefAmount,kaleido,frameBlur,frameHue,frameSat,frameLum,grainType,grainAmount=$*
   
   if $grainType==2
      grainType=3
   fi
   
   foreach {
      
      [-1]
      if $kaleido
         fx_kaleidoscope. 50,50,0,0,100,10,2
      fi
      b. $frameBlur
      
      l.
         rgb2hsl split c
         +. $frameLum c. 0,1
         +.. $frameSat c.. 0,1
         +... $frameHue %... 360
         a c hsl2rgb
      done
      
      100%,100%,1,1,0
      fx_frame_round. $frameSize,20,1,255,255,255,255,0,0,3
      remove_opacity.
      n. 0,255
      
      [-1]
      
      if $frameType>=1 # inset, groove, ridge
         negate.
      fi
      
      if $frameType>=2 # groove, ridge
         gradient_norm.
      fi
      
      if $frameType==3 # ridge
         negate.
      fi
      
      fx_smooth_antialias. 100,10,5,0,50,50
      
      negate.
      


      l.
         # inspired by emboss_image of Reptorian
         b. $reliefWidth
         gradient2rgb. 0 n. 0,255
         [-1]
         rgb2hsv[-2,-1] split[-2,-1] c

         l[-3--1] +[-3] {315} %[-3] 360 done
         l[-6--4] +[-3] {135} %[-3] 360 done
         l[-3--1] a c hsv2rgb s c done
         l[-6--4] a c hsv2rgb s c done
         rm[^-6,-3]
         negate..
         / 2
         +. 128
         blend grainmerge,1
      done
      to_rgb.
      
      apply_curve. 1,0,{127-$reliefAmount},255,{128+$reliefAmount}
      
      fill[0] i#2*i#1+(255-i#2)*i n[0] 0,255
      rm.. rm..
      
      blend grainmerge,1
      fx_noise. $grainAmount,$grainType,16,1,0,50,50

   }


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 -> Frames -> Frame [Relief] (prerelease)".

Have fun! :)

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


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: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 03, 2022 1:06 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Claude.
Thanks for the new filter. :bigthup
My favorite is the Groove type.


Attachments:
Frame Groove.jpg
Frame Groove.jpg [ 132.95 KiB | Viewed 1647 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 03, 2022 1:50 pm  (#3) 
Offline
GimpChat Member

Joined: Jan 13, 2022
Posts: 58
Windows 7 GIMP 2.8 I copied and pasted the code in note pad, saved to desktop. By default the extension is txt. I put it in the folder it says app data GMIC. It did not show. I then changed the extension to py and it also did not show. If someone could help.... Thank you.


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 03, 2022 2:34 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
You need to change the extension from user.txt to user.gmic.
I don't know if Windows 7 will be the same.
In Windows 10, the correct (my) location is:
c:\Users\***\AppData\Roaming\user.gmic
(doesn't work from a location that seems more logical:
c:\Users\***\AppData\Roaming\gmic\user.gmic)

For Samj portable:
d:\Gimp-2.10.32_Portable_Samj_32-64bit-Win\GMIC_Filters\user.gmic
(but NO: d:\Gimp-2.10.32_Portable_Samj_32-64bit-Win\GMIC_Filters\gmic\user.gmic)

*** = Your 'name' from the login to the system {your_id}

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Mon Jul 04, 2022 11:07 am  (#5) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4046
This may seem a little odd, I ran into the same problem when trying to save the user.gmic to Roaming directly from Notepad. It never showed up because the system could not recognize the filetype association and requesting an app to associate it. So, I had to trick Windows into recognizing it as a gmic file by saving it to Roaming/gmic, before moving it to Roaming. Only then, did it work. Odd, but true.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Mon Jul 04, 2022 11:16 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 771
Location: SEA - South East Asia
I got some problems.... especially with the "Relief Width" slider
Same problem whatever G'MIC for GIMP or the G'MIC stand alone, all my G'MIC are downloaded from gmic.eu
MX Linux 21.1 / G'MIC 3.1.5

Default settings... what is this rectangle?
Image

others problems > getting all dark
Image

what kind of effect is this?
Image

moving only 1 slider from default setting....
Image

G'MIC stand alone, 1 example (getting dark) but got ALL the very same problems as with G'MIC for GIMP
Image

Image is from pexels.com I "zipped" it here to be sure the GC's website will not modify it
Attachment:
pexels-photo-358457.jpeg.7z [676.04 KiB]
Downloaded 34 times


In case you got any doubt about where I did put it
Attachment:
ksnip_20220705-123646.png
ksnip_20220705-123646.png [ 59.33 KiB | Viewed 1535 times ]

_________________
Patrice


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Tue Jul 05, 2022 11:56 am  (#7) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Thanks MareroQ, gimpmannew, mahvin, PixLab for your valuable feedback. :tyspin

PixLab, I can't reproduce your problems.
Have you put the code into an empty '.gmic' file ? It's not mandatory but I've already had a problem because of the preceding code!
Do other users have the same problems ?

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


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Tue Jul 05, 2022 12:41 pm  (#8) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
PixLab, I just succeeded to reproduce your first problem in Krita.
I'm going to investigate it.

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


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Tue Jul 05, 2022 9:51 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 771
Location: SEA - South East Asia
cli345 wrote:
Have you put the code into an empty '.gmic' file ? It's not mandatory but I've already had a problem because of the preceding code!

Indeed, there is only your code. The .gmic was created just for your code :bigthup

cli345 wrote:
PixLab, I just succeeded to reproduce your first problem in Krita.
I'm going to investigate it.

I feel relieved now, I got scared that I was alone :mrgreen:
In case it helps, I have the same problem with the appImage GIMP 2.10.25 from the continuous release of aferrero "GIMP_AppImage-git-2.10.25-20210610-withplugins-x86_64.AppImage" (G'MIC 3.1.5, same G'MIC as the distro's GIMP which is GIMP 2.10.28)>> https://github.com/aferrero2707/gimp-ap ... continuous

Just moving only the "Relief Width" slider to the right will show inconsistency and different effect further away I move it step by step. Like getting all dark and or having suddenly the huge "bumps?", then all dark again further away to the right I move this slider.

Moving the "Relief Width" slider to the left from default setting, make the picture brighter, and the "white" rectangle larger but thinner
Hope this helps

Thanks a lot cli345 for your answers and your time :tyspin

_________________
Patrice


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Tue Jul 26, 2022 11:44 am  (#10) 
Offline
GimpChat Member

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

Thanks to David Tschumperlé (issue 402), I think I have fixed the bug.
#@gui ____<b>Frames</b>
#------------------
#@gui Frame [Relief] (prerelease): cl_reliefFrame_prerelease, cl_reliefFrame_prerelease(1)
#@gui : note = note("<b>Frame Limit:</b>")
#@gui : Type = choice(1, "Outset", "Inset", "Groove", "Ridge")
#@gui : Size = float(10,6,20)
#@gui : Relief Width = float(1.5,0,10)
#@gui : Relief Amount = float(75,0,127)
#@gui : sep = separator()
#@gui : note = note("<b>Frame Area:</b>")
#@gui : Kaleidoscope Effect = bool(1)
#@gui : Frame Blur = float(60,5,80)
#@gui : Frame Hue Change = float(0,-180,180)
#@gui : Frame Saturation Change = float(0,-1,1)
#@gui : Frame Luminosity Change = float(0,-0.5,0.5)
#@gui : sep = separator()
#@gui : note = note("<b>Graininess:</b>")
#@gui : Graininess Type = choice("Gaussian", "Uniform", "Poisson")
#@gui : Graininess Amount = float(0,0,80)
#@gui : sep = separator()
#@gui : note = note("<small>Author: <i>Claude Lion</i>.      Latest Update: <i>2022/07/01</i>.</small>")
#@gui : note = note("<small>It uses filters of David Tschumperlé.</small>")

cl_reliefFrame_prerelease:
   
   frameType,frameSize,reliefWidth,reliefAmount,kaleido,frameBlur,frameHue,frameSat,frameLum,grainType,grainAmount=$*
   
   if $grainType==2
      grainType=3
   fi
   
   foreach {
     
      [-1]
      if $kaleido
         fx_kaleidoscope. 50,50,0,0,100,10,2
      fi
      b. $frameBlur
     
      l.
         rgb2hsl split c
         +. $frameLum c. 0,1
         +.. $frameSat c.. 0,1
         +... $frameHue %... 360
         a c hsl2rgb
      done
     
      100%,100%,1,1,0
      fx_frame_round. $frameSize,20,1,255,255,255,255,0,0,3
      remove_opacity.
      n. 0,255
     
      [-1]
     
      if $frameType>=1 # inset, groove, ridge
         negate.
      fi
     
      if $frameType>=2 # groove, ridge
         gradient_norm.
      fi
     
      if $frameType==3 # ridge
         negate.
      fi
     
      fx_smooth_antialias. 100,10,5,0,50,50
     
      negate.
     


      l.
         # inspired by emboss_image of Reptorian
         b. $reliefWidth
         fill. if(abs(i)<1e-10,0,i) # to work around https://github.com/dtschump/gmic/issues/402
         gradient2rgb. 0 n. 0,255
         [-1]
         rgb2hsv[-2,-1] split[-2,-1] c

         l[-3--1] +[-3] {315} %[-3] 360 done
         l[-6--4] +[-3] {135} %[-3] 360 done
         l[-3--1] a c hsv2rgb s c done
         l[-6--4] a c hsv2rgb s c done
         rm[^-6,-3]
         negate..
         / 2
         +. 128
         blend grainmerge,1
      done
      to_rgb.
     
      apply_curve. 1,0,{127-$reliefAmount},255,{128+$reliefAmount}
     
      fill[0] i#2*i#1+(255-i#2)*i n[0] 0,255
      rm.. rm..
     
      blend grainmerge,1
      fx_noise. $grainAmount,$grainType,16,1,0,50,50

   }

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


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Fri Jul 29, 2022 8:02 pm  (#11) 
Offline
GimpChat Member

Joined: Oct 16, 2017
Posts: 41
@cli346

I think you're learning fast, and you did something I never thought of after all these years

The way you use $*, and using variables that way, I haven't thought of that for GUI filters.


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sat Jul 30, 2022 12:30 pm  (#12) 
Offline
GimpChat Member

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

@Reptorian
You have also made a lot of code that I don't understand yet.
Thanks to you, I have been able to include the groove effect into the "Comicbook" filter and into the "Lineart" filter.
This filter ("Frame [Relief]") doesn't stand without the algorithm of your "emboss_image" function.

Thank you very much Reptorian! :tyspin

@PixLab
Thank you for all the details. Is the bug fixed now in your configuration?

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


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sat Jul 30, 2022 9:17 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Claude.
Adjusting the 'Frame Hue Change' changes not only the frame but also the image.
The intended effect?


Attachments:
FrameRelief.jpg
FrameRelief.jpg [ 108.82 KiB | Viewed 904 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 31, 2022 12:13 am  (#14) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 7714
Location: On the other side of this screen
@MareroQ
Probably something you have already checked but by your screen shot I would think the 'output mode' should be for new layer/s

_________________


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 31, 2022 2:56 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
MareroQ wrote:
Hi Claude.
Thanks for the new filter. :bigthup
My favorite is the Groove type.

My fav as well! Thank you Claude! :paint

Attachment:
GMIC-Frames_RD-2022-07-31_034938.jpg
GMIC-Frames_RD-2022-07-31_034938.jpg [ 117.14 KiB | Viewed 884 times ]

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Jul 31, 2022 3:26 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 771
Location: SEA - South East Asia
MareroQ wrote:
Hi Claude.
Adjusting the 'Frame Hue Change' changes not only the frame but also the image.
The intended effect?


Me as well, and image is becoming fully gray
Hi Claude,
I would add, adding noise, add noise to the whole image (I would expect on the frame only)
Other than that, excellent fix, it works well now :clap

Attachment:
ksnip_20220731-135722.jpg
ksnip_20220731-135722.jpg [ 445.23 KiB | Viewed 882 times ]

_________________
Patrice


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Aug 07, 2022 12:19 pm  (#17) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
MareroQ wrote:
Adjusting the 'Frame Hue Change' changes not only the frame but also the image.
The intended effect?
Hi MareroQ! :)

:oops: Oops, it's a bug. I've forgotten to test an image with alpha channel. Here is the fixed code:
#@gui ____<b>Frames</b>
#------------------
#@gui Frame [Relief] (prerelease): cl_reliefFrame_prerelease, cl_reliefFrame_prerelease(1)
#@gui : note = note("<b>Frame Limit:</b>")
#@gui : Type = choice(1, "Outset", "Inset", "Groove", "Ridge")
#@gui : Size = float(10,6,20)
#@gui : Relief Width = float(1.5,0,10)
#@gui : Relief Amount = float(75,0,127)
#@gui : sep = separator()
#@gui : note = note("<b>Frame Area:</b>")
#@gui : Kaleidoscope Effect = bool(1)
#@gui : Frame Blur = float(60,5,80)
#@gui : Frame Hue Change = float(0,-180,180)
#@gui : Frame Saturation Change = float(0,-1,1)
#@gui : Frame Luminosity Change = float(0,-0.5,0.5)
#@gui : sep = separator()
#@gui : note = note("<b>Graininess:</b>")
#@gui : Graininess Type = choice("Gaussian", "Uniform", "Poisson")
#@gui : Graininess Amount = float(0,0,80)
#@gui : sep = separator()
#@gui : note = note("<small>Author: <i>Claude Lion</i>.      Latest Update: <i>2022/08/01</i>.</small>")
#@gui : note = note("<small>It uses filters of David Tschumperlé and an algorithm of Reptorian.</small>")

cl_reliefFrame_prerelease:
   
   frameType,frameSize,reliefWidth,reliefAmount,kaleido,frameBlur,frameHue,frameSat,frameLum,grainType,grainAmount=$*
   
   if $grainType==2
      grainType=3
   fi
   
   foreach {
      remove_opacity.
     
      [-1]
      if $kaleido
         fx_kaleidoscope. 50,50,0,0,100,10,2
      fi
      b. $frameBlur
     
      l.
         rgb2hsl split c
         +. $frameLum c. 0,1
         +.. $frameSat c.. 0,1
         +... $frameHue %... 360
         a c hsl2rgb
      done
     
      100%,100%,1,1,0
      fx_frame_round. $frameSize,20,1,255,255,255,255,0,0,3
      remove_opacity.
      n. 0,255
     
      [-1]
     
      if $frameType>=1 # inset, groove, ridge
         negate.
      fi
     
      if $frameType>=2 # groove, ridge
         gradient_norm.
      fi
     
      if $frameType==3 # ridge
         negate.
      fi
     
      fx_smooth_antialias. 100,10,5,0,50,50
     
      negate.
     
    
    
      l.
         # inspired by emboss_image of Reptorian
         b. $reliefWidth
         fill. if(abs(i)<1e-10,0,i) # to work around https://github.com/dtschump/gmic/issues/402
         gradient2rgb. 0 n. 0,255
         [-1]
         rgb2hsv[-2,-1] split[-2,-1] c
    
         l[-3--1] +[-3] {315} %[-3] 360 done
         l[-6--4] +[-3] {135} %[-3] 360 done
         l[-3--1] a c hsv2rgb s c done
         l[-6--4] a c hsv2rgb s c done
         rm[^-6,-3]
         negate..
         / 2
         +. 128
         blend grainmerge,1
      done
      to_rgb.
     
      apply_curve. 1,0,{127-$reliefAmount},255,{128+$reliefAmount}
     
      fill[0] i#2*i#1+(255-i#2)*i n[0] 0,255
      rm.. rm..
     
      blend grainmerge,1
      fx_noise. $grainAmount,$grainType,16,1,0,50,50

   }



PixLab wrote:
I would add, adding noise, add noise to the whole image (I would expect on the frame only)

Hi PixLab! :)

I haven't thought putting noise on the frame only (I wanted to emulate a kind of metal box). I think I'll give the two possibilities.

Thank you all for your valuable feedback! :tyspin :)

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


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Aug 07, 2022 5:57 pm  (#18) 
Offline
GimpChat Member

Joined: Oct 16, 2017
Posts: 41
Hi cli345,

I would like to remind you that gmic-community github has been moved: https://discuss.pixls.us/t/change-locat ... ub/32016/4


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Sun Aug 07, 2022 10:05 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 771
Location: SEA - South East Asia
cli345 wrote:
Hi MareroQ! :)
:oops: Oops, it's a bug. I've forgotten to test an image with alpha channel. Here is the fixed code:
-----------
Hi PixLab! :)
I haven't thought putting noise on the frame only (I wanted to emulate a kind of metal box). I think I'll give the two possibilities.

Thank you all for your valuable feedback! :tyspin :)


Nice fix cli345, now hue/saturation/luminosity work like a charm :clap
:tyspin

_________________
Patrice


Top
 Post subject: Re: New G'MIC filter "Frame [Relief]"
PostPosted: Fri Aug 19, 2022 12:25 pm  (#20) 
Offline
GimpChat Member

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

Here is just a little improvement:
  • Default type is now "Groove".
  • An additional parameter ("Graininess on") enables to choose where the graininess is put.
Here is the code:
#@gui ____<b>Frames</b>
#------------------
#@gui Frame [Relief] (prerelease): cl_reliefFrame_prerelease, cl_reliefFrame_prerelease(1)
#@gui : note = note("<b>Frame Limit:</b>")
#@gui : Type = choice(2, "Outset", "Inset", "Groove", "Ridge")
#@gui : Size = float(10,6,20)
#@gui : Relief Width = float(1.5,0,10)
#@gui : Relief Amount = float(75,0,127)
#@gui : sep = separator()
#@gui : note = note("<b>Frame Area:</b>")
#@gui : Kaleidoscope Effect = bool(1)
#@gui : Frame Blur = float(60,5,80)
#@gui : Frame Hue Change = float(0,-180,180)
#@gui : Frame Saturation Change = float(0,-1,1)
#@gui : Frame Luminosity Change = float(0,-0.5,0.5)
#@gui : sep = separator()
#@gui : note = note("<b>Graininess:</b>")
#@gui : Graininess Type = choice("Gaussian", "Uniform", "Poisson")
#@gui : Graininess Amount = float(0,0,80)
#@gui : Graininess on = choice("Frame", "Picture", "Both")
#@gui : sep = separator()
#@gui : note = note("<small>Author: <i>Claude Lion</i>.      Latest Update: <i>2022/08/18</i>.</small>")
#@gui : note = note("<small>It uses filters of David Tschumperlé and an algorithm of Reptorian.</small>")

cl_reliefFrame_prerelease:
   
   frameType,frameSize,reliefWidth,reliefAmount,kaleido,frameBlur,frameHue,frameSat,frameLum,grainType,grainAmount,grainFrameOn=$*
   
   if $grainType==2
      grainType=3
   fi
   
   foreach {
      remove_opacity.
     
      [-1]
      if $kaleido
         fx_kaleidoscope. 50,50,0,0,100,10,2
      fi
      b. $frameBlur
     
      l.
         rgb2hsl split c
         +. $frameLum c. 0,1
         +.. $frameSat c.. 0,1
         +... $frameHue %... 360
         a c hsl2rgb
      done
     
      if $grainFrameOn==0
         fx_noise. $grainAmount,$grainType,16,1,0,50,50
      elif $grainFrameOn==1
         fx_noise.. $grainAmount,$grainType,16,1,0,50,50
      fi
     
      100%,100%,1,1,0
      fx_frame_round. $frameSize,20,1,255,255,255,255,0,0,3
      remove_opacity.
      n. 0,255
     
      [-1]
     
      if $frameType>=1 # inset, groove, ridge
         negate.
      fi
     
      if $frameType>=2 # groove, ridge
         gradient_norm.
      fi
     
      if $frameType==3 # ridge
         negate.
      fi
     
      fx_smooth_antialias. 100,10,5,0,50,50
     
      negate.
     
    
    
      l.
         # inspired by emboss_image of Reptorian
         b. $reliefWidth
         fill. if(abs(i)<1e-10,0,i) # to work around https://github.com/dtschump/gmic/issues/402
         gradient2rgb. 0 n. 0,255
         [-1]
         rgb2hsv[-2,-1] split[-2,-1] c
    
         l[-3--1] +[-3] {315} %[-3] 360 done
         l[-6--4] +[-3] {135} %[-3] 360 done
         l[-3--1] a c hsv2rgb s c done
         l[-6--4] a c hsv2rgb s c done
         rm[^-6,-3]
         negate..
         / 2
         +. 128
         blend grainmerge,1
      done
      to_rgb.
     
      apply_curve. 1,0,{127-$reliefAmount},255,{128+$reliefAmount}
     
      fill[0] i#2*i#1+(255-i#2)*i n[0] 0,255
      rm.. rm..
     
      blend grainmerge,1
      if $grainFrameOn==2
         fx_noise. $grainAmount,$grainType,16,1,0,50,50
      fi
   }


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


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Outcomes using Bas Relief 2024 rel.1.2.1 <<<

326

No new posts Attachment(s) My filters of the year 2024: 3) Bas Relief 1.2.1 <<

4

No new posts Attachment(s) Transparent Frame

3

No new posts Attachment(s) Glass Frame Effects

29

No new posts Here are a couple of frame transitions I just did

9



* Login  



Powered by phpBB3 © phpBB Group