Popular Posts

Sunday, April 10, 2011

Polarizing Filter Effect: Using the GIMP

Polarizing Filter Effect:
Polarized

Original 


This will add a digital polarizing filter effect:

Here is the code -->

;*************************************************************************************** 
; Polarize script for GIMP 2.x
; --------------------------------------------------------------------
(define (script-fu-polarize
        img
        drawable
    )
    (gimp-undo-push-group-start img)
    (let*    (
            (new-img (car (plug-in-decompose 1 img drawable "Red" 1)))
            (new-layer (car (gimp-image-get-active-layer new-img)))
             (TEMP0 (car (gimp-layer-copy drawable FALSE)))
             (TEMP1 (car (gimp-layer-copy drawable FALSE)))
        )
        (gimp-image-add-layer img TEMP1 -1)
        (gimp-image-add-layer img TEMP0 -1)
        (gimp-edit-copy new-layer)
        (gimp-floating-sel-anchor (car (gimp-edit-paste TEMP0 0)))
        (gimp-layer-set-mode TEMP0 SOFTLIGHT-MODE)
        (gimp-image-merge-down img TEMP0 EXPAND-AS-NECESSARY)
        (set! TEMP0 (car (gimp-image-get-active-layer img)))
        (gimp-layer-set-name TEMP0 "Polarize")
        (gimp-image-delete new-img)
        (gimp-undo-push-group-end img)
        (gimp-displays-flush)

    )
)
(script-fu-register
 "script-fu-polarize"
 _"<Image>/Script-Fu/Artistic/Polarize"
 "Creates a Polarize filter Effect."
 ""
 ""
 "2011"
 "RGB*"
 SF-IMAGE    "Image"        0
 SF-DRAWABLE    "Drawable"    0
)

2 comments:

  1. Looks just what I want. I'm not too familiar with this scripting language. Is it possible to perform this filtering effect through the gui?

    ReplyDelete
  2. Error: eval: unbound variable: img

    ReplyDelete