;Glazing Guide ;(c) 2008 Andrew Springman / This software is licensed under the CC-GNU GPL. See http://creativecommons.org/licenses/GPL/2.0/ ;Written for GIMP 2.4 ; ;This script creates a new image with Y, MY, CMY, CMYK, M, C and K layers ;The purpose is to create references for painting the image using a glazing ;technique with only four layers (like a printing process). ; ;This is different than decomposing to CMYK because this script yields color ;on white instead of white value (in place of the color) on black ; ;It is assumed that the glazing will be done in the order Y, M, C, K ;(from brightest to darkest). This yields the most vibrant colors. ; ;Under Windows, put me in the share/gimp/2.0/scripts directory under your GIMP installation. ;Under Linux: put me in ~/.Gimp-2.4/scripts (define (script-fu-glazing-guide source_image source_drawable) (let* ( ;create a new image layered with grayscale value representations of each color (image (car (plug-in-decompose 1 source_image source_drawable "CMYK" 1))) ;obtain the drawables for each layer (k (car (gimp-image-get-active-drawable image))) (y (- k 1)) (m (- y 1)) (c (- m 1)) ;declare for later (cmyk 1) (cmy 1) (my 1) ) ;decompose leaves us in grayscale mode and colorify requires rgb mode (gimp-convert-rgb image) ;make a layer for the original image (set! cmyk (car (gimp-layer-new-from-drawable source_drawable image))) ;grab the drawable from the old image (gimp-image-set-active-layer image c) ;we want the new layer on the top (gimp-image-add-layer image cmyk -1) ;insert layer above active layer ;color the c, m, and y layers with the inverse color (plug-in-colorify 1 image c '(255 0 0)) ;red for cyan (plug-in-colorify 1 image m '(0 255 0)) ;green for magenta (plug-in-colorify 1 image y '(0 0 255)) ;blue for yellow ;add c, m and y layers (gimp-drawable-set-visible cmyk 0) ;hide original image layer (gimp-drawable-set-visible k 0) ;hide key (black) layer (gimp-layer-set-mode c ADDITION-MODE) ;put cyan layer in addition mode (gimp-layer-set-mode m ADDITION-MODE) ;put majenta layer in addition mode (gimp-layer-set-mode y ADDITION-MODE) ;put yellow layer in addition mode (gimp-edit-copy-visible image) ;grab the projection (set! cmy (car (gimp-edit-paste c 0))) ;paste the projection in as a floating layer (gimp-drawable-set-name cmy "cmy") ;name it to detatch it from layer c ;add m and y layers (gimp-drawable-set-visible cmy 0) ;hide newly calculated layer (gimp-drawable-set-visible c 0) ;hide cyan layer (gimp-edit-copy-visible image) ;grab the projection (set! my (car (gimp-edit-paste cmy 0))) ;paste the projection in as a floating layer (gimp-drawable-set-name my "my") ;name it to detatch it from layer cmy ;restore layers to normal mode (gimp-layer-set-mode c NORMAL-MODE) (gimp-layer-set-mode m NORMAL-MODE) (gimp-layer-set-mode y NORMAL-MODE) ;restore invisible layers (gimp-drawable-set-visible c 1) (gimp-drawable-set-visible k 1) (gimp-drawable-set-visible cmy 1) (gimp-drawable-set-visible cmyk 1) ;invert to yield intended color on white (gimp-invert c) (gimp-invert m) (gimp-invert y) (gimp-invert k) (gimp-invert my) (gimp-invert cmy) ;give names to remaining layers (gimp-drawable-set-name c "c") (gimp-drawable-set-name m "m") (gimp-drawable-set-name y "y") (gimp-drawable-set-name k "k") (gimp-drawable-set-name cmyk "cmyk") ;put yellow layer on top because it's first in the glazing process (gimp-image-raise-layer-to-top image y) (gimp-image-set-active-layer image y) ;swap magenta only layer and cyan only layer to put in glazing order (gimp-image-raise-layer image m) ;show off the finished work -- well, you still have to paint it, but this script isn't going to do that for you :P (gimp-display-new image) ) ) (script-fu-register "script-fu-glazing-guide" _"_Glazing Guide..." _"Decompose into CMYK Glazing Guide for Painting" "Andrew Springman / andrewspringman@yahoo.com" "(c) 2008 Andrew Springman / This software is licensed under the CC-GNU GPL. See http://creativecommons.org/licenses/GPL/2.0/" "2008 02 12" "" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 ) (script-fu-menu-register "script-fu-glazing-guide" "/Colors/Components")