; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ;; This plugin takes the current image active layer, ;; and creates an animation with the specified number ;; of frames. Each frame has the hue of the previous ;; frame rotated by a uniform amount. The new frames ;; are created in a new image, to give a complete ;; 360 degree hue rotation. ;; ;; Tested on version 1.2.1, should work on higher versions. ;; ;; Certainly needs improvements and additional features still. ;; ;; If anyone is interested, contact me at ashrb2k@yahoo.co.in ;; ;; Ashish Bhambhani, India, June 2003. ;; (define (script-fu-huecycling-anim Img Lyr Num) (set! Lyr (car (gimp-image-get-active-layer Img))) (gimp-selection-all Img) (gimp-edit-copy Lyr) (gimp-selection-none Img) (set! Img (car (gimp-image-new (car (gimp-drawable-width Lyr)) (car (gimp-drawable-height Lyr)) (car (gimp-image-base-type Img))))) (set! Lyr (car (gimp-layer-new Img (car (gimp-drawable-width Lyr)) (car (gimp-drawable-height Lyr)) (car (gimp-image-base-type Img)) "Frame # 0" 100 0))) (gimp-image-add-layer Img Lyr 0) (gimp-display-new Img) (set! Fl (car (gimp-edit-paste Lyr 0))) (gimp-floating-sel-anchor Fl) (gimp-image-undo-disable Img) (set! fnum 1) (while (< fnum Num) (set! L (car (gimp-layer-copy Lyr FALSE))) (gimp-layer-set-name L (string-append "Frame " (number->string fnum 10 3 0))) (set! offset (/ (* 360 fnum) Num)) (if (> offset 180) (set! offset (- (- 360 offset)))) (gimp-hue-saturation L 0 offset 0 0) (gimp-image-add-layer Img L 0) (set! fnum (+ 1 fnum)) ) (gimp-image-undo-enable Img) ) (script-fu-register "script-fu-huecycling-anim" "/Script-Fu/Animators/Hue-cycling..." "Creates an animation that rotates the hue of an image" "Ashish Bhambhani (ashrb2k@yahoo.co.in)" "Ashish Bhambhani" "2003 June" "RGB*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-VALUE "Number of frames (atleast 2)" "10")