Added saturate script function (+documentation), it also desaturates

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@800 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-12-30 00:48:39 +00:00
parent 3ceec52c1c
commit 796975bd9d
11 changed files with 114 additions and 54 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+2 -1
View File
@@ -67,7 +67,8 @@ These functions are built into the program, other [[type:function]]s can be defi
| [[fun:combine_blend]] Blend two images together using a given [[type:combine|combining mode]].
| [[fun:set_mask]] Set the transparancy mask of an image.
| [[fun:set_alpha]] Change the transparency of an image.
| [[fun:set_combine]] Chnage how the image should be combined with the background.
| [[fun:set_combine]] Change how the image should be combined with the background.
| [[fun:saturate]] Saturate/desaturate an image.
| [[fun:enlarge]] Enlarge an image by putting a border around it.
| [[fun:crop]] Crop an image, giving only a small subset of it.
| [[fun:drop_shadow]] Add a drop shadow to an image.
+21
View File
@@ -0,0 +1,21 @@
Function: saturate
--Usage--
> saturate(input: image, amount: saturation amount)
Saturate or desaturate an image. Saturation makes the colors brighter, desaturation makes the image more grey.
To saturate use an amount between @0@ (no saturation) and @1@ (super crazy, too much saturation).
To desaturate use an amount between @0@ (no desaturation) and @-1@ (convert to greyscale).
--Parameters--
! Parameter Type Description
| @input@ [[type:image]] Image to (de)saturate.
| @alpha@ [[type:double]] Saturation factor.
--Examples--
> saturate("image5.png", amount: 0.5) == [[Image]]
>>> saturate(<img src="image5.png" alt='"image5.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: 0.5) == <img src="image_saturate1.png" alt='"image_saturate1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
> saturate("image5.png", amount: -0.5) == [[Image]]
>>> saturate(<img src="image5.png" alt='"image5.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: -0.5) == <img src="image_saturate2.png" alt='"image_saturate2.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />