(define (script-fu-ignatov_znachok theImage theDrawable) ; Variable init (let* ( (foregroundWidth (car (gimp-image-width theImage))) (foregroundHeight (car (gimp-image-height theImage))) (raznoct) (circle) (layercircle (car (gimp-layer-new theImage foregroundWidth foregroundHeight 0 "circle" 100 NORMAL) ) ) (layershadow (car (gimp-layer-new theImage foregroundWidth foregroundHeight 0 "shadow" 100 NORMAL) ) ) (layerligth (car (gimp-layer-new theImage foregroundWidth foregroundHeight 0 "ligth" 80 NORMAL) ) ) ) ; Задание размера выделения (set! raznoct (- foregroundWidth foregroundHeight)) (if ( > raznoct 0) (set! circle foregroundHeight) (set! circle foregroundWidth)) ;(set! circle foregroundWidth) ;; Save Original picture to Original layer ; Rename current picture to "Original" (gimp-drawable-set-name theDrawable "Original") (gimp-context-push) (gimp-image-undo-disable theImage) (gimp-layer-add-alpha layercircle ) (gimp-layer-add-alpha layershadow ) (gimp-layer-add-alpha layerligth ) (gimp-layer-add-alpha theDrawable) ;(gimp-layer-add-alpha layersvet ) (gimp-image-add-layer theImage layercircle 0) (gimp-image-add-layer theImage layershadow 0) (gimp-image-add-layer theImage layerligth 0) ;(gimp-image-add-layer theImage layersvet 0) (gimp-selection-all theImage) (gimp-edit-clear layercircle) (gimp-edit-clear layershadow) (gimp-edit-clear layerligth) ;(gimp-edit-clear layersvet) (gimp-selection-none theImage) ; выделение окружности (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( - ( / circle 2) ( / circle 80))) ( - ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 80))) ( - circle ( / circle 40)) ( - circle ( / circle 40)) 2 1 0 0 ) ;заполнение градиентом (gimp-context-set-foreground '(175 255 147)) (gimp-context-set-background '(94 178 66)) (gimp-context-set-gradient "Основной в фоновый (RGB)") (gimp-edit-blend layercircle CUSTOM-MODE NORMAL-MODE GRADIENT-RADIAL ; gradient type 100 ; opacity 0 ; offset REPEAT-NONE ; repeat FALSE ; reverse FALSE ; supersampling 0 0 ; FALSE ; dithering ( / foregroundWidth 2) ; x2 ( / foregroundHeight 2) ; y2 ( / foregroundWidth) ( + ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 80)) ) ; x1 y1 ) ;рисование каймы (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( - ( / circle 2) ( / circle 160))) ( - ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 160))) ( - circle ( / circle 80)) ( - circle ( / circle 80)) 2 1 0 0 ) (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( - ( / circle 2) ( / circle 80))) ( - ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 80))) ( - circle ( / circle 40)) ( - circle ( / circle 40)) 1 1 0 0 ) (gimp-context-set-foreground '(47 47 47)) (gimp-edit-fill layercircle 0) ;обесцвечивание значка и изменение mode (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( - ( / circle 2) ( / circle 160))) ( - ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 160))) ( - circle ( / circle 80)) ( - circle ( / circle 80)) 2 1 0 0 ) (gimp-colorize layercircle 0 0 0) (gimp-context-set-background '(47 47 47)) (gimp-layer-set-mode layercircle 21) ; удаление ненужной части картинки (gimp-selection-invert theImage) (gimp-edit-clear theDrawable) ; создание тени внутри значка (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( - ( / circle 2) ( / circle 48))) ( - ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 48))) ( - circle ( / circle 24)) ( - circle ( / circle 24)) 2 1 1 10 ) (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( - ( / circle 2) ( / circle 35))) ( - ( / foregroundHeight 2) ( - ( / circle 2) ( / circle 35))) ( - circle ( / circle 17.5)) ( - circle ( / circle 17.5)) 1 1 1 10 ) (gimp-edit-fill layershadow 0) (gimp-selection-none theImage) (plug-in-gauss TRUE theImage layershadow 9 9 1) (plug-in-gauss TRUE theImage layershadow 9 9 1) ; создание пятен света (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( / circle 4)) ( - ( / foregroundHeight 2) ( / circle 2.1)) ( / circle 2) ( / circle 3 ) 2 1 0 0 ) (gimp-context-set-foreground "white") (gimp-context-set-gradient "Основной в прозрачный") (gimp-edit-blend layerligth CUSTOM-MODE NORMAL-MODE GRADIENT-LINEAR ; gradient type 100 ; opacity 0 ; offset REPEAT-NONE ; repeat FALSE ; reverse FALSE ; supersampling 0 0 ; FALSE ; dithering ( / foregroundWidth 2) ; x2 ( - ( / foregroundHeight 2) ( / circle 2.1)) ; y2 ( / foregroundWidth 2) ( + ( - ( / foregroundHeight 2) ( / circle 2.1)) ( / circle 3)) ) (gimp-selection-none theImage) (gimp-ellipse-select theImage ( - ( / foregroundWidth 2) ( / circle 4)) ( + ( / foregroundHeight 2) ( / circle 8)) ( / circle 2) ( / circle 3 ) 2 1 0 0 ) (gimp-ellipse-select theImage 0 0 foregroundWidth ( - foregroundHeight ( / circle 11)) 1 1 0 0 ) ;(gimp-edit-fill layerligth 0) (gimp-context-set-foreground "white") (gimp-context-set-gradient "Основной в прозрачный") (gimp-edit-blend layerligth CUSTOM-MODE NORMAL-MODE GRADIENT-LINEAR ; gradient type 100 ; opacity 0 ; offset REPEAT-NONE ; repeat FALSE ; reverse FALSE ; supersampling 0 0 ; FALSE ; dithering ( / foregroundWidth 2) ; x2 ( - foregroundHeight ( / circle 20)) ; y2 ( / foregroundWidth 2) ( - foregroundHeight ( / circle 11)) ) (gimp-selection-none theImage) (gimp-drawable-transform-rotate layerligth 1.2 TRUE ( / foregroundWidth 2) ( / foregroundHeight 2) 0 0 TRUE 1 0 ) (gimp-selection-none theImage) (gimp-image-clean-all theImage) (gimp-image-undo-enable theImage) (gimp-displays-flush) ) ) (script-fu-register "script-fu-ignatov_znachok" ;func name "Значок" ;menu label "Создаёт значок из любого изображения" ;description "Игнатов Роман Иванович" ;author "copyright 2010" ;copyright notice "September 26, 2010" ;date created "" ;image type that the script works on SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 ) (script-fu-menu-register "script-fu-ignatov_znachok" _"/Filters/Decor")