;; -*-scheme-*- ;; Copyright, Alan Horkan 2004, Dedicated to the Public Domain. (define (script-fu-layers-new-from-copy image drawable) (gimp-image-undo-group-start image) (if (= (car (gimp-selection-is-empty image)) TRUE) (gimp-selection-all image) ) (gimp-edit-copy drawable) (gimp-floating-sel-to-layer (car (gimp-edit-paste drawable FALSE))) ;; use this if you dont want a layer called "Pasted Layer" ; (gimp-drawable-set-name drawable _"Layer") (gimp-image-undo-group-end image) (gimp-displays-flush) ) (define (script-fu-layers-new-from-cut image drawable) (gimp-image-undo-group-start image) (if (= (car (gimp-selection-is-empty image)) TRUE) (gimp-selection-all image) ) ; convert the selection to a floating selection (gimp-selection-float drawable 0 0) ; convert the floating selection to a layer (gimp-floating-sel-to-layer (car (gimp-image-get-floating-sel image))) ;; use this if you dont want a layer called "Floating Selection" ; (gimp-drawable-set-name drawable _"Layer") (gimp-image-undo-group-end image) (gimp-displays-flush) ) (set! menu _"/Layer/New/") ;(set! menu _"/Layer/New ") ;; uncomment above line to move items up to the Layer menu. (set! authors "Alan Horkan. ") (set! copyrights "Alan Horkan, 2004. Public Domain. ") (set! date "2004 04 02 UTC") (script-fu-register "script-fu-layers-new-from-copy" (string-append menu _"Layer from _Copy") ; Ctrl+J "Create a new Layer from a Copy of the current Selection. If nothing is selected the whole Layer is copied and made into a new Layer. " "Alan Horkan" copyrights date "*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 ) (script-fu-register "script-fu-layers-new-from-cut" (string-append menu _"Layer from Cu_t") ; Ctrl+Shift+J "Create a new Layer from a Cut of the current Selection. If nothing is selected the whole Layer is cut and made into a new Layer. To avoid jagged edges make sure Selection Antialiasing is not turned off. " "Alan Horkan" copyrights date "*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 ) ;; Adobe Photoshop 7.0 ;; _Layer, Ne_w, Layer via _Copy Ctrl+J ;; _Layer, Ne_w, Layer via Cu_t Ctrl+Shift+J ;; via, Latin, meaning by or from. Keep it Simple Stupid, use from! ;; Jasc Paint Shop Pro 8.0 ;; _Selections, _Promote Selection to Layer Ctrl+Shift+P (copies) ;; _Edit, Paste as New _Layer Ctrl+L