Post Reply 

pls translate the InkPen script into manual steps for me

Jun 20, 2014, 20:19
Post: #1
pls translate the InkPen script into manual steps for me
can some somebody translate this script-code into manual steps for me, please ?!

Code:
(define (FU-inkpen
        img
        drawable
        color
        lightness
        length
        outlines?
        grid?
        inMerge
    )
    (gimp-image-undo-group-start img)
    (if (not (= RGB (car (gimp-image-base-type img))))
             (gimp-image-convert-rgb img))
  (let* (
     (width (car (gimp-drawable-width drawable)))
     (height (car (gimp-drawable-height drawable)))
     (old-selection (car (gimp-selection-save img)))
     (image-type (car (gimp-image-base-type img)))
         (blur (* height  0.01 ))
         (gridcolor '(128 128 255))
     (layer-type (car (gimp-drawable-type drawable)))
     (layer-tempa (car (gimp-layer-new img width height layer-type "tempa"  100 NORMAL-MODE)))
     (layer-tempb (car (gimp-layer-new img width height layer-type "tempb"  100 NORMAL-MODE)))
     (layer-tempc (car (gimp-layer-new img width height layer-type "tempc"  100 NORMAL-MODE)))
     (layer-tempd (car (gimp-layer-new img width height layer-type "tempd"  100 NORMAL-MODE)))
     (layer-tempe (car (gimp-layer-new img width height layer-type "tempe"  100 NORMAL-MODE)))
     (layer-tempf (car (gimp-layer-new img width height layer-type "tempf"  100 NORMAL-MODE)))
     (layer-tempg (car (gimp-layer-new img width height layer-type "tempg"  100 NORMAL-MODE)))
       )

    (if (eqv? (car (gimp-selection-is-empty img)) TRUE)
        (gimp-drawable-fill old-selection WHITE-IMAGE-FILL)) ; so Empty and All are the same.
    (gimp-selection-none img)


    (gimp-drawable-fill layer-tempb WHITE-IMAGE-FILL)
    (gimp-image-insert-layer img layer-tempb 0 -1)
    (gimp-edit-copy drawable)
    (gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempb 0)))
    (gimp-hue-saturation layer-tempb 0 0 lightness 0)
    (gimp-threshold layer-tempb 125 255)

    (gimp-drawable-fill layer-tempa WHITE-IMAGE-FILL)
    (gimp-image-insert-layer img layer-tempa 0 -1)
    (plug-in-randomize-hurl 1 img layer-tempa 25 1 1 10)
    (plug-in-mblur 1 img layer-tempa 0 length 135 1 0)
    (gimp-threshold layer-tempa 215 230)

    (gimp-drawable-fill layer-tempd WHITE-IMAGE-FILL)
    (gimp-image-insert-layer img layer-tempd 0 -1)
    (gimp-edit-copy drawable)
    (gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempd 0)))
    (gimp-hue-saturation layer-tempd 0 0 lightness 0)
    (gimp-threshold layer-tempd 75 255)

    (gimp-drawable-fill layer-tempc WHITE-IMAGE-FILL)
    (gimp-image-insert-layer img layer-tempc 0 -1)
    (plug-in-randomize-hurl 1 img layer-tempc 25 1 1 10)
    (plug-in-mblur 1 img layer-tempc 0 length 45 0 0)
    (gimp-threshold layer-tempc 215 230)

    (gimp-layer-set-mode layer-tempa 10)
    (gimp-layer-set-mode layer-tempc 10)

    (gimp-image-merge-down img layer-tempc 0)
    (set! layer-tempc (car (gimp-image-get-active-layer img)))
    (gimp-layer-set-mode layer-tempc 3)

    (gimp-image-merge-down img layer-tempa 0)
    (set! layer-tempa (car (gimp-image-get-active-layer img)))
    (gimp-layer-set-mode layer-tempa 0)


    (gimp-image-merge-down img layer-tempc 0)
    (set! layer-tempa (car (gimp-image-get-active-layer img)))
    (gimp-layer-set-mode layer-tempa 0)
;------------------------------------------------
    (if (eqv? outlines? TRUE)
        (begin
    (gimp-image-insert-layer img layer-tempe 0 -1)
    (gimp-edit-copy drawable)
    (gimp-floating-sel-anchor (car (gimp-edit-paste layer-tempe 0)))
    (plug-in-photocopy 1 img layer-tempe 5.0 1.0 0.0 0.8)
    (gimp-levels layer-tempe 0 215 235 1.0 0 255)
    (gimp-layer-set-mode layer-tempe 3)
    (gimp-image-merge-down img layer-tempe 0)
    (set! layer-tempa (car (gimp-image-get-active-layer img)))
      ))
;------------------------------------------------
    (gimp-context-set-foreground color)
    (gimp-drawable-fill layer-tempf 0)
    (gimp-image-insert-layer img layer-tempf 0 -1)
    (gimp-layer-set-mode layer-tempf 4)
    (gimp-image-merge-down img layer-tempf 0)
    (set! layer-tempa (car (gimp-image-get-active-layer img)))

;------------------------------------------------
    (if (eqv? grid? TRUE)
        (begin
    (gimp-drawable-fill layer-tempg WHITE-IMAGE-FILL)
    (gimp-image-insert-layer img layer-tempg 0 -1)
    (gimp-image-lower-item img layer-tempg)
    (plug-in-grid 1 img layer-tempg 1 16 8 gridcolor 64 1 16 8 gridcolor 64 0 2 6 gridcolor 128)
    (plug-in-gauss 1 img layer-tempg 0.5 0.5 0)

    (gimp-layer-set-mode layer-tempa 9)
    (gimp-image-merge-down img layer-tempa 0)
    (set! layer-tempa (car (gimp-image-get-active-layer img)))
    ))
;------------------------------------------------

    (gimp-image-select-item img CHANNEL-OP-REPLACE old-selection)
    (gimp-selection-invert img)
    (if (eqv? (car (gimp-selection-is-empty img)) FALSE) ; both Empty and All are denied
        (begin
        (gimp-edit-clear layer-tempa)
        ))

    (gimp-item-set-name layer-tempa "Inkpen")
    (gimp-image-select-item img CHANNEL-OP-REPLACE old-selection)
    (gimp-image-remove-channel img old-selection)

    (if (= inMerge TRUE)(gimp-image-merge-visible-layers img EXPAND-AS-NECESSARY))
    (gimp-image-undo-group-end img)
    (gimp-displays-flush)
  )
)

(script-fu-register "FU-inkpen"
    "<Image>/Script-Fu/Artistic/Inkpen"
    "Creates a inkpen drawing effect"
    "Eddy Verlinden <eddy_verlinden@hotmail.com>"
    "Eddy Verlinden"
    "2007, juli"
    "*"
    SF-IMAGE      "Image"                            0
    SF-DRAWABLE   "Drawable"                          0
    SF-COLOR      "Ink Color"                       '(0 0 0)
    SF-ADJUSTMENT "Lightness"                       '(0 -100 100 1 10 0 0)
    SF-ADJUSTMENT "Stroke length"                   '(30 10 50 1 10 0 0)
    SF-TOGGLE     "Outlines"                          TRUE
    SF-TOGGLE     "Blue grid"                         FALSE
    SF-TOGGLE     "Merge layers when complete?"     FALSE
)

please visit Gimp-Science-Labs Blog
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 21, 2014, 02:46 (This post was last modified: Jun 21, 2014 03:25 by fluffybunny2.)
Post: #2
RE: pls translate the InkPen script into manual steps for me
(Jun 20, 2014 20:19)Esper Wrote:  can some somebody translate this script-code into manual steps for me, please ?!
I'll give it a shot...
Code:
If not an RGB image the convert it to RGB

Note: All new layers will have the same width and height of the original image, type set to RGB and created in Normal mode and 100% opacity

If a selection exists, just apply effects to the selected area

Add layer tempb to the image above the active layer
Fill layer tempb with white
Edit->Copy the original layer
Edit->Paste the original layer into layer tempb and anchor.
Using Colors->Hue Saturation adjust tempb's Lightness to the User's entered value
Using Colors->Threshold using adjust tempb's threshold using 125 as the low value and 255 as the high value.

Add layer tempa to the image above the active layer
Fill layer tempa with white
Filters->Noise->Hurl layer tempa with 10 as the seed, Randomisation 25% and Repeat set to 1
Filters->Blur->Motion Blur layer tempa - Linear, length set to the User's entered value, Angle 135.
Using Colors->Threshold using adjust tempa's threshold using 215 as the low value and 230 as the high value.

Add layer tempd to the image above the active layer
Fill layer tempd with white
Edit->Copy the original layer
Edit->Paste the original layer into layer tempd and anchor.
Using Colors->Hue Saturation adjust tempd's Lightness to the User's entered value
Using Colors->Threshold using adjust tempd's threshold using 75 as the low value and 255 as the high value.

Add layer tempc to the image above the active layer
Fill layer tempc with white
Filters->Noise->Hurl layer tempc with 10 as the seed Randomisation 25% and Repeat set to 1
Filters->Blur->Motion Blur layer tempc - Linear, length set to the User's entered value, Angle 45.
Using Colors->Threshold using adjust temp's threshold using 215 as the low value and 230 as the high value.

Set Layer Mode to Lighten Only on layer tempa
Set Layer Mode to Lighten Only on layer tempc

Merge Down layer tempc to the first visible layer below using Expand as Necessary.
Assign layer tempc to the newly merged layer
Set Layer Mode to Multiply on layer tempc

Merge Down layer tempa to the first visible layer below using Expand as Necessary.
Assign layer tempa to the newly merged layer
Set Layer Mode to Normal on layer tempa

Merge Down layer tempc to the first visible layer below using Expand as Necessary.
Assign layer tempa to the newly merged layer
Set Layer Mode to Normal on layer tempa

If user selected Outlines then...

    Add layer tempe to the image above the active layer
    Edit->Copy the original layer
    Edit->Paste the original layer into layer tempe and anchor.
    Filters->Artistic->Photocopy layer tempe Mask Radius 5, Sharpnes 1 Perctange Black 0 Percentage White .8
    Colors->Levels layer tempe Channel=Value, Input Balck Point-215 Gamma-1.0 Input White point-235 Output Black-0 Output White-255
    Set Layer Mode to Multiply on layer tempe
    Merge Down layer tempe to the first visible layer below using Expand as Necessary.
    Assign layer tempa to the newly merged layer


Set foreground color to the color chosen by user     
Add layer tempf to the image above the active layer
Fill layer tempf with the foreground color
Set Layer Mode to Screen on layer tempf
Merge Down layer tempf to the first visible layer below using Expand as Necessary.
Assign layer tempa to the newly merged layer


If user selected Blue Grid

    Add layer tempg to the image above the active layer
    Fill layer tempg with White
    Move layer tempg down 1 position
    Filters->Render->Pattern->Grid Settings=Horiz Width 1, Horiz Spacing 16, Horiz Offset 8, Color set to R=128,G=128,B=255,Alpha=64:Vert Width 1, Vert Spacing 16, Vert Offset 8, Color set to R=128,G=128,B=255,Alpha=64:Intersection Width 0, Intersection Spacing 2, Intersection Offset 6, Color set to R=128,G=128,B=255,Alpha=128
    Filters->Blur->Gaussian Blur layer tempg Set X to .5, Y to .5, Method set to IIR

    Set Layer Mode to Darken Only on layer tempa
    Merge Down layer tempa to the first visible layer below using Expand as Necessary.
    Assign layer tempa to the newly merged layer


Replace any the current selection with the original selection
Selection->Invert
Edit->Clear on layer tempa

Set layer tempa's name to "Inkpen"
Reselect any selection saved
Remove the saved channel.

If Merge Layers chosen then merge all visible layers.
Hope this helps you Esper Smile
Find all posts by this user
Quote this message in a reply
Jun 21, 2014, 02:50
Post: #3
RE: pls translate the InkPen script into manual steps for me
yes, a lot !!!

thanks FB <3

please visit Gimp-Science-Labs Blog
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Request for script chlebna 1 193 Sep 13, 2017 09:35
Last Post: ythgilb
  Request for script - Guillotine + Watermark sunslick 1 253 Sep 4, 2017 08:51
Last Post: ythgilb
  Script-fu: How to create new, addressable layer using gimp-floating-sel-to-layer Bertholom√§us 1 273 Aug 31, 2017 14:32
Last Post: Bertholomäus
  How to modify this script-fu? Zakary81 1 219 Aug 23, 2017 12:48
Last Post: paynekj
  Need help in running a gui script-fu via command line eyalzek 2 373 Oct 4, 2014 14:05
Last Post: eyalzek

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS