-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathFX.html
More file actions
212 lines (202 loc) · 12.6 KB
/
FX.html
File metadata and controls
212 lines (202 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image Effects</title>
<link rel="StyleSheet" href="style/magick.css" type="text/css" />
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0085C0"
vlink="#800080" alink="#0085C0">
<h1>Image Effects</h1>
<hr />
<p>You have your choice of these special effects:</p>
<dl>
<dd>
<dl>
<dt><b>channel F(x)</b></dt>
<dd>exchange, extract, or copy one or more image channels.
<p>The expression consists of one or more channels, either mnemonic or numeric (e.g. red, 1), separated by certain operation symbols as follows:</p>
<pre class="text">
<=> exchange two channels (e.g. red<=>blue)
=> copy one channel to another channel (e.g. red=>green)
= assign a constant value to a channel (e.g. red=50%)
, write new image with channels in the specified order (e.g. red, green)
| replace the specified channel in the first image with the specified
channel in the second image (e.g. red | green)
; separate each specified channel to its own image (e.g. red; green;
blue)
</pre>
<p>For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:</p>
<pre class="text">
-channel-fx "red; green; blue"
</pre>
<p>A channel without an operation symbol implies separate (i.e, semicolon).</p>
<pre class="text">
red; green; blue
</pre>
</dd>
<dt><b>Charcoal drawing</b></dt>
<dd>simulate a charcoal drawing. Good parameter values are odd
numbers from 3 to 31</dd><br />
<dt><b>Clut</b></dt>
<dd>apply the clipboard image as a color lookup table to the image.</dd><br />
<dt><b>Color-matrix</b></dt>
<dd>This option permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255).
As an example, to add contrast to an image with offsets, try this
<pre>
<i>1.5 0.0 0.0 0.0, 0.0, -0.157 0.0 1.5 0.0 0.0, 0.0, -0.157 0.0 0.0 1.5 0.0, 0.0, -0.157 0.0 0.0 0.0 1.0, 0.0, 0.0 0.0 0.0 0.0 0.0, 1.0, 0.0 0.0 0.0 0.0 0.0, 0.0, 1.0</i>
</pre></dd><br />
<dt><b>Convolve</b></dt>
<dd>apply a convolution kernel to the image. Given the kernel
<i>order</i>, you would supply <i>order*order</i> float values. For
example, the parameter would look like this for a 3x3 Gaussian
kernel:</dd><br />
<dd>
<pre>
<i>1, 2, 1, 2, 4, 2, 1, 2, 1</i>
</pre></dd><br />
<dt><b>Distort</b></dt>
<dd>distort an image with as defined by a source and destination quadrilateral.</dd><br />
<dd>The parameter is a set of coordinate pairs (e.g. x1,y1,u1,v1 x2,y2,u2,v2 ...).</dd><br />
<dt><b>Evaluate</b></dt>
<dd>evaluate an arithmetic, relational, or logical expression.</dd><br />
<dd>The parameter is a value to evaluate against each pixel.</dd><br />
<dt><b>Function</b></dt>
<dd>apply function to image.</dd><br />
<dd>The parameter is a set of coordinate pairs (e.g. x1,y1,u1,v1 x2,y2,u2,v2 ...).</dd><br />
<dt><b>Fx</b></dt>
<dd>evaluate expression for each pixel in the specified channel. The Fx expressions includes any combination of the following:<br />
<li> <em>x</em> <kbd>^</kbd> <em>y</em>: exponentiation (<em>x<sup>y</sup></em>)</li>
<li> <kbd>(</kbd> ... <kbd>)</kbd>: grouping</li>
<li> <em>x</em> <kbd>*</kbd> <em>y</em>: multiplication (the asterisk <kbd>*</kbd> is optional, for example, <kbd>2u</kbd> or <kbd>2(x+y)</kbd> are acceptable)</li>
<li> <em>x</em> <kbd>/</kbd> <em>y</em>: division</li>
<li> <em>x</em> <kbd>%</kbd> <em>y</em>: modulo</li>
<li> <em>x</em> <kbd>+</kbd> <em>y</em>: addition</li>
<li> <em>x</em> <kbd>-</kbd> <em>y</em>: subtraction</li>
<li> <em>x</em> <kbd><<</kbd> <em>y</em>: left shift</li>
<li> <em>x</em> <kbd>>></kbd> <em>y</em>: right shift</li>
<li> <em>x</em> <kbd><</kbd> <em>y</em>: boolean relation, returns value 1.0 if <em>x</em> < <em>y</em>, otherwise 0.0</li>
<li> <em>x</em> <kbd><=</kbd> <em>y</em>: boolean relation, returns value 1.0 if <em>x</em> <= <em>y</em>, otherwise 0.0</li>
<li> <em>x</em> <kbd>></kbd> <em>y</em>: boolean relation, returns value 1.0 if <em>x</em> > <em>y</em>, otherwise 0.0</li>
<li> <em>x</em> <kbd>>=</kbd> <em>y</em>: boolean relation, returns value 1.0 if <em>x</em> >= <em>y</em>, otherwise 0.0</li>
<li> <em>x</em> <kbd>==</kbd> <em>y</em>: boolean relation, returns value 1.0 if <em>x </em>==<em> y</em>, otherwise 0.0</li>
<li> <em>x</em> <kbd>!=</kbd> <em>y</em>: boolean relation, returns value 1.0 if <em>x </em>!=<em> y</em>, otherwise 0.0</li>
<li> <em>x</em> <kbd>&</kbd> <em>y</em>: binary AND</li>
<li> <em>x</em> <kbd>|</kbd> <em>y</em>: binary OR</li>
<li> <em>x</em> <kbd>&&</kbd> <em>y</em>: logical AND connective, returns value 1.0 if <em>x</em> > 0 and <em>y</em> > 0, otherwise 0.0</li>
<li> <em>x</em> <kbd>||</kbd> <em>y</em>: logical OR connective (inclusive), returns value 1.0 if <em>x</em> > 0 or <em>y</em> > 0 (or both), otherwise 0.0</li>
<li> <kbd>~</kbd><em>x</em>: logical NOT operator, returns value 1.0 if <em>not</em> <em>x</em> > 0, otherwise 0.0</li>
<li> <kbd>+</kbd><em>x</em>: unary plus, returns 1.0*value</li>
<li> <kbd>-</kbd><em>x</em>: unary minus, returns -1.0*value</li>
<li> <em>x</em> <kbd>?</kbd> <em>y</em> :</b> <em>z</em>: ternary conditional expression, returns value <em>y</em> if <em>x</em> > 0, otherwise <em>z</em>; only one ternary conditional permitted per statement</li>
<li> <em>x</em> <kbd>=</kbd> <em>y</em>: assignment </li>
<li> <em>x</em> <kbd>;</kbd> <em>y</em>: statement separator </li>
<li> <kbd>pi</kbd>: constant (3.141659...)</li>
<li> <kbd>e</kbd>: constant (2.71828...)</li>
<li> <kbd>QuantumRange</kbd>: constant maximum pixel value (255 for Q8, 65535 for Q16)</li>
<li> <kbd>QuantumScale</kbd>: constant 1.0/<kbd>QuantumRange</kbd></li>
<li> <kbd>intensity</kbd>: pixel intensity</li>
<li> <kbd>hue</kbd>: pixel hue</li>
<li> <kbd>saturation</kbd>: pixel saturation</li>
<li> <kbd>luminosity</kbd>: pixel luminosity</li>
<li> <kbd>red, green, blue</kbd>, etc.: color names</li>
<li> <kbd>#ccc, #cbfed0, #b9e1cc00</kbd>, etc.: color hex values</li>
<li> <kbd>rgb(), rgba(), cmyk(), cmyka(), hsl(), hsla()</kbd>: color functions</li>
<li> <kbd>s,t,u,v,n,i,j,w,h,z,r,g,b,a,o,c,y,m,k</kbd>: symbols</li>
<li> <kbd>abs(</kbd><em>x</em><kbd>)</kbd>: absolute value function</li>
<li> <kbd>acos(</kbd><em>x</em><kbd>)</kbd>: arc cosine function</li>
<li> <kbd>alt(</kbd><em>x</em><kbd>)</kbd>: sign alternation function (returns 1 if <kbd>int(</kbd><em>x</em><kbd>)</kbd> is even, -1 if <kbd>int(</kbd><em>x</em><kbd>)</kbd> is odd)</li>
<li> <kbd>asin(</kbd><em>x</em><kbd>)</kbd>: arc sine function</li>
<li> <kbd>atan(</kbd><em>x</em><kbd>)</kbd>: arc tangent function</li>
<li> <kbd>atan2(</kbd><em>y</em>,<em>x</em><kbd>)</kbd>: arc tangent function of two variables</li>
<li> <kbd>ceil(</kbd><em>x</em><kbd>)</kbd>: smallest integral value not less than argument</li>
<li> <kbd>cos(</kbd><em>x</em><kbd>)</kbd>: cosine function</li>
<li> <kbd>debug(</kbd><em>x</em><kbd>)</kbd>: print value for debugging</li>
<li> <kbd>exp(</kbd><em>x</em><kbd>)</kbd>: natural exponential function (<em>e<sup>x</sup></em>)</li>
<li> <kbd>floor(</kbd><em>x</em><kbd>)</kbd>: largest integral value not greater than argument</li>
<li> <kbd>int(</kbd><em>x</em><kbd>)</kbd>: greatest integer function (returns greatest integer less than or equal to <em>x</em>)</li>
<li> <kbd>ln(</kbd><em>x</em><kbd>)</kbd>: natural logarithm function</li>
<li> <kbd>log(</kbd><em>x</em><kbd>)</kbd>: logarithm base 10</li>
<li> <kbd>max(</kbd><em>x</em>,</b> <em>y</em><kbd>)</kbd>: maximum of <em>x</em> and <em>y</em></li>
<li> <kbd>min(</kbd><em>x</em>,</b> <em>y</em><kbd>)</kbd>: minimum of <em>x</em> and <em>y</em></li>
<li> <kbd>mod(</kbd><em>x</em>,</b> <em>y</em><kbd>)</kbd>: floating-point remainder function</li>
<li> <kbd>pow(</kbd><em>x</em>,<em>y</em><kbd>)</kbd>: power function (<em>x<sup>y</sup></em>)</li>
<li> <kbd>rand()</kbd>: value uniformly distributed over the interval [0.0, 1.0) with a 2 to the 128th-1 period</li>
<li> <kbd>sign(</kbd><em>x</em><kbd>)</kbd>: returns 1 if <em>x</em> is less than 0 otherwise 1</li>
<li> <kbd>sin(</kbd><em>x</em><kbd>)</kbd>: sine function</li>
<li> <kbd>sqrt(</kbd><em>x</em><kbd>)</kbd>: square root function</li>
<li> <kbd>tan(</kbd><em>x</em><kbd>)</kbd>: tangent function</li></dd><br /><br />
<dd>The expression semantics include these rules:
<li>symbols are case insensitive</li>
<li>only one ternary conditional (e.g. x ? y : z) per statement</li>
<li>statements are assignments or the final expression to return</li>
<li>an assignment starts a statement, it is not an operator</li>
<li>assignments to built-ins do not throw errors and have no effect; e.g. <kbd>r=3.0; r</kbd> returns the pixel red color value, not 3.0</li>
</dd><br />
<dt><b>Hald-Clut</b></dt>
<dd>apply the clipboard image as a Hald color lookup table to the image.</dd><br />
<dt><b>Implode</b></dt>
<dd>implode/explode image pixels about the center. A positive
parameter implodes while a negative parameter explodes the
image.</dd><br />
<dt><b>mosaic</b></dt>
<dd>create an mosaic from an image sequence.</dd><br />
<dt><b>Morph</b></dt>
<dd>morphs an image sequence. Both the image pixels and size are
linearly interpolated to give the appearance of a meta-morphosis
from one image to the next. Specify the parameter as the number of
in-between images to generate. If you have a single image in your
sequence, the clipboard image is used as the morph anchor.</dd><br />
<dt><b>Oil Paint</b></dt>
<dd>simulate an oil painting. Each pixel is replaced by the most
frequent color in a circular neighborhood whose width is specified
as a radius. Good parameter values are odd numbers from 3 to 31</dd><br />
<dt><b>Sepia Tone</b></dt>
<dd>apply a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning. Threshold ranges from 0 to MaxRGB and is a measure of the extent of the sepia toning. A threshold of 80% is a good starting point for a reasonable tone.</dd><br />
<dt><b>Shadow</b></dt>
<dd>simulate an image shadow. Start with a parameter of 50x5+20+30.
The first value is the percent opacity, the second is the blur sigma value,
and the third and fourth value is the shadow offset relative to the original image</dd><br />
<dt><b>Sketch</b></dt>
<dd>simulate a pencil sketch. Try a parameter of 0x20+135.</dd><br />
<dt><b>Solarize</b></dt>
<dd>negate all pixels above the threshold level. Specify the
parameter as the percent threshold of the intensity (0 -
99.9%).</dd><br />
<dt><b>Sparse-Color</b></dt>
<dd>given a set of coordinates, sparse-color interpolates the colors found at those coordinates, across the whole image, using various methods.</dd><br />
<dt><b>Stegano</b></dt>
<dd>hide the clipboard image within this image. The parameter is
the offset within the image to begin any hiding.</dd><br />
<dt><b>Stereo</b></dt>
<dd>combine two image to create a stereo anaglyph. The left side of
the stereo pair is saved as the red channel of the output image.
The right sife is saved as the green channel. Red-blue stereo
glasses are required to properly view the stereo image.</dd><br />
<dt><b>Swirl</b></dt>
<dd>swirl image pixels about the center. <i>Degrees</i> defines the
tightness of the swirl.</dd><br />
<dt><b>Tint</b></dt>
<dd>tint the image with the fill color. Tint applies a color vector
to each pixel in the image. The length of the vector is 0 for black
and white and at its maximum for the midtones. The vector weighting
function in between is f(x) = (1-(4.0*((x-0.5)*(x-0.5)))). The
dynamic weighting can be controlled by a constant percentage
(0..100) given as the parameter for tint (e.g. 50%). Usually
de-saturating the image is what you want before tinting.</dd><br />
<dt><b>Vignette</b></dt>
<dd>soften the edges of the image in vignette style. Start with a parameter of 0x20.
The first value is the blur radius, the second is the blur sigma value,
and the third and fourth value is the vignette offset relative to the original image</dd><br />
<dt><b>Wave</b></dt>
<dd>alter an image along a sine wave. Specify <i>amplitude</i> and
<i>wavelength</i> as the parameter to effect the characteristics of
the wave:
<pre>
<i><amplitude>x<wavelength></i>
</pre></dd><br /></dl></dd><br /></dl>
<p>See <a href="images/examples.jpg">examples</a> of select
<b>ImageMagick Studio</b> effects.</p>
<hr />
</body>
</html>