Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skript for mirroring left and right side of portrait photo
#3
gimp-edit-named-paste creates a floating selection that needs to be anchored:
Code:
(define (script-fu-two-faces img drw)
  (let* (
        (drawable-width (car (gimp-drawable-width drw)))
        (halfdrawable-width (* drawable-width 0.5))
        (drawable-height (car (gimp-drawable-height drw)))
        (leftimage (car (gimp-image-new drawable-width drawable-height RGB)))
        (leftlayer (car (gimp-layer-new leftimage drawable-width drawable-height 0 "tfl" 100 0)))
        (rightimage (car (gimp-image-new drawable-width drawable-height RGB)))
        (rightlayer (car (gimp-layer-new rightimage drawable-width drawable-height 0 "tfr" 100 0)))
        (floatingLayer 0)
        )

        
        (gimp-image-insert-layer leftimage leftlayer 0 0)
        (gimp-drawable-fill leftlayer WHITE-FILL)
        (gimp-display-new leftimage)
        (gimp-image-insert-layer rightimage rightlayer 0 0)
        (gimp-drawable-fill rightlayer WHITE-FILL)
        (gimp-display-new rightimage)



        (gimp-edit-named-copy drw "tobepastedleft")
        (set! floatingLayer (car (gimp-edit-named-paste leftlayer "tobepastedleft" TRUE)))
        (gimp-floating-sel-anchor floatingLayer)
        (gimp-displays-flush)


        (gimp-item-transform-flip drw halfdrawable-width 0 halfdrawable-width drawable-height)

        (gimp-edit-named-copy drw "tobepastedright")
        (set! floatingLayer (car (gimp-edit-named-paste rightlayer "tobepastedright" TRUE)))
        (gimp-floating-sel-anchor floatingLayer)
        (gimp-displays-flush)

        )
        )


(script-fu-register "script-fu-two-faces"
  "Two faces..."
  "Creates an image from left side of the face"
  "K.Imai"
  "K.Imai"
  "2017"
  ""
  SF-IMAGE      "Image"             0
  SF-DRAWABLE   "Drawable to apply" 0
)

(script-fu-menu-register "script-fu-two-faces" "<Image>")
Reply


Messages In This Thread
RE: Skript for mirroring left and right side of portrait photo - by Kevin - 08-07-2017, 07:00 PM

Forum Jump: