Thursday, February 25, 2010

Colorwheel with gradiant


Here is my color wheel script. This will generate a full color wheel and hue bars. The number of hue bars can be specified in the script options.
----
(define ( SupaColorWheel Colorbars )
;makes a new image and layer 1024x1024
(define img (car (gimp-image-new 1024 1024 0)))
(define baselayer (car(gimp-layer-new img 1024 1024 0 "layer 1" 100 0)))
(gimp-image-add-layer img baselayer -1)
;set up variables and constants
(define i 0)
(define j 0)
(define numrots 765)
(define numbars Colorbars)
(define barrot (/ 6.28318531 numbars))
(define barHuerot (/ 200 numbars))
;set base colors
(gimp-context-set-background '(255 255 255))
(gimp-context-set-foreground '(255 0 0))

;vv this loop draws the wheel.
(set! i 0)
(while (< i numrots)
;make new layer for color slice
(define colorlayer (car(gimp-layer-new img 3 256 0 "layer 1" 100 0)))
(gimp-image-add-layer img colorlayer -1)
;add red to white gradiant
(gimp-edit-blend colorlayer 3 0 0 100 0 0 FALSE FALSE 1 0 TRUE 256 0 256 256)
;change hue to angle
(gimp-hue-saturation colorlayer 0 (- (* 0.2614379085 i) 100) 0 0)
;move and rotate layer into position
(gimp-layer-translate colorlayer 512 256)
(gimp-drawable-transform-rotate colorlayer (* 0.008213314118 i) FALSE 512 512 0 2 TRUE 3 0)
;mergelayers
(gimp-image-merge-visible-layers img 2)


(set! i (+ i 1))
)

(set! j 0)
;reset colors to red and cyan so they are opposites
(gimp-context-set-background '(255 0 0))
(gimp-context-set-foreground '(0 255 255))
;vv draw bars
(while (< j numbars)
;make new layer for color bar
(define colorlayer (car(gimp-layer-new img 15 256 0 "layer 1" 100 0)))
(gimp-image-add-layer img colorlayer -1)
;add red and cyan gradiant
(gimp-edit-blend colorlayer 3 0 0 100 0 0 FALSE FALSE 1 0 TRUE 256 0 256 256)
;change hue to angle
(gimp-hue-saturation colorlayer 0 (- (* barHuerot j) 100) 0 0)
;move and rotate layer to position
(gimp-layer-translate colorlayer 512 0)
(gimp-drawable-transform-rotate colorlayer (* barrot j) FALSE 512 512 0 2 TRUE 3 0)
;flatten
(gimp-image-merge-visible-layers img 2)


(set! j (+ j 1))
)

(gimp-display-new img)

)

;register script
(script-fu-register
"SupaColorWheel" ;function name
"Supa ColorWheel" ;menu label
"Makes a Supa Color Wheel" ;description
"Eric Geusz" ;author
"copyright 2010" ;copyright notice
"FEB 23th 2010" ;date created
""
;lets player pick number of bars
SF-ADJUSTMENT "Colorbars" '(12 3 96 1 1 0 0) ;passes the number of sections to gimp
)

(script-fu-menu-register "SupaColorWheel" "<Image>Filters/IFDM/205")
----

Wednesday, February 17, 2010

Broken Hue filter

So i found out that the hue and saturation function (gimp-hue-saturation) works from -180 to 180, like it says, as in it doesn't crash. But it only rotates the hues between -100 and 100. Any number out side of that fails to receive the hue modification.

Example:

I applied the gradient to the full circle, -180 being the top, 0 being the bottom and +180 being the top as well. But as you can see it doesn't work for all angles outside of -100 or 100

Tuesday, February 16, 2010

Colorwheel with gradients



Here is the blue yellow gradient and the script

(define img (car (gimp-image-new 512 512 0)))

(define baselayer (car(gimp-layer-new img 512 512 0 "layer 1" 100 0)))
(gimp-image-add-layer img baselayer -1)

(gimp-display-new img)

(gimp-context-set-background '(255 255 0))
(gimp-context-set-foreground '(0 0 255 ))

(gimp-edit-blend baselayer 3 0 0 100 0 0 FALSE FALSE 1 0 TRUE 0 0 512 512)

Colorwheel with gradients


I didn't figure out how to make wedges but i did it another way. This way will let me make a smooth and continuous wheel where every possible hue the computer knows is represented.

gradients
Here is the script.

(define img (car (gimp-image-new 512 512 0)))

(define baselayer (car(gimp-layer-new img 512 512 0 "layer 1" 100 0)))
(gimp-image-add-layer img baselayer -1)

(gimp-display-new img)

(define i 0)

(define numrots 765)


(gimp-context-set-background '(255 255 255))
(set! i 0)
(while (< i numrots)
(define colorlayer (car(gimp-layer-new img 3 256 0 "layer 1" 100 0)))
(gimp-image-add-layer img colorlayer -1)


(if (> i -1)
(gimp-context-set-foreground '((- 255 200) 0 0))
)

(if (> i 255)
(gimp-context-set-foreground '(0 255 0))

)

(if (> i 510)
(gimp-context-set-foreground '( 0 0 255))

)

(gimp-edit-blend colorlayer 3 0 0 100 0 0 FALSE FALSE 1 0 TRUE 256 0 256 256)

(gimp-layer-translate colorlayer 256 0)
(gimp-drawable-transform-rotate colorlayer (* 0.008211150327 i) FALSE 256 256 0 2 TRUE 3 0)

(gimp-image-merge-visible-layers img 2)


(set! i (+ i 1))
)

Thursday, February 11, 2010

I found out that gimp has a python-fu console. http://www.gimp.org/docs/python/index.html
so can I write my scripts in python since we had a whole semester learning python?

Tuesday, February 2, 2010

Here is my color wheel. It is made up of random images.


And here are my three color change bars, going form CYM to RGB

How to make the color wheel


Step 1 is to start with a square blank image. It can be any size you want.


Step 2. To help us place the images we should make a guide. Start by using a larg fuzzy brush to paint out the 3 primaries, Red Green and Blue like this.


Step 3. Next add the secondary colors, yellow, cyan and magenta between them.


Step 4. Next paint in black and white so our wheel's value will vary.


Step 5 Now start finding images on the internet and pasting pieces of them in that match hues found in the guide. I suggest starting with the middle most saturated colors and move out out the edges.

Step 6. It should look something like this when completed.

Step 7. Now to make it a circle, go to Filters/Distort/polar coordinates. the default settings should be fine. Hit ok and it should whip your image into a sexy circle!

Monday, February 1, 2010

I learned in Maya that you can change the shadow color of a light to mimic exactly what was demonstrated in class with the lights and the opposite colors and such.