summaryrefslogtreecommitdiff
path: root/utilities/tests/effects.tap
blob: be8a15996b50043d570cbabfe6901b4b388bd5c8 (plain)
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#!/bin/sh
# -*- shell-script -*-
# Copyright (C) 2004-2012 GraphicsMagick Group
# Test image processing
# This script should be executed prior to Montage
. ./common.shi
. ${top_srcdir}/utilities/tests/common.sh

# Number of tests we plan to execute
test_plan_fn 59

OUTFILE=TileAddNoise_out.miff
rm -f ${OUTFILE}
test_command_fn 'AddNoise' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} +noise Laplacian -label AddNoise ${OUTFILE}

OUTFILE=TileAffine_out.miff
rm -f ${OUTFILE}
test_command_fn 'Affine' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -affine 1,0,0.785,1,0,0 -transform -label Affine ${OUTFILE}

OUTFILE=TileAnnotate_out.miff
ANNOTATE_CMD_FILE=annotate_cmds_out.txt
echo 'gravity North text 0,20 "Magick"' > ${ANNOTATE_CMD_FILE}
rm -f ${OUTFILE}
test_command_fn 'Annotate' -F TTF ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -fill gold -pointsize 14 \
	-font ${GENERIC_TTF} \
	-draw @${ANNOTATE_CMD_FILE} \
	-label Annotate ${OUTFILE}

OUTFILE=TileThresholdBlack_out.miff
rm -f ${OUTFILE}
test_command_fn 'Black-Threshold' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -black-threshold "20%" \
                   -label 'Black-Threshold' ${OUTFILE}

OUTFILE=TileBlur_out.miff
rm -f ${OUTFILE}
test_command_fn 'Blur' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -blur 0x1 -label Blur ${OUTFILE}

OUTFILE=TileBorder_out.miff
rm -f ${OUTFILE}
test_command_fn 'Border' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -bordercolor gold -border 6x6 -label Border ${OUTFILE}

OUTFILE=TileChannel_out.miff
rm -f ${OUTFILE}
test_command_fn 'Channel' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -colorspace cmyk -channel yellow -label Channel ${OUTFILE}

OUTFILE=TileCharcoal_out.miff
rm -f ${OUTFILE}
test_command_fn 'Charcoal' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -charcoal 0x1 -label Charcoal ${OUTFILE}

OUTFILE=TileComposite_out.miff
rm -f ${OUTFILE}
test_command_fn 'Composite' ${GM} composite ${COMPOSITE_FLAGS} ${SMILE_MIFF} -geometry +35+65 ${MODEL_MIFF} -label Composite ${OUTFILE}

OUTFILE=TileContrast_out.miff
rm -f ${OUTFILE}
test_command_fn 'Contrast' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -contrast -label Contrast ${OUTFILE}

OUTFILE=TileConvolve_out.miff
rm -f ${OUTFILE}
# 1,1,1,
# 1,4,1,
# 1,1,1
test_command_fn 'Convolve' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -convolve 1,1,1,1,4,1,1,1,1 -label Convolve ${OUTFILE}

OUTFILE=TileCrop_out.miff
rm -f ${OUTFILE}
test_command_fn 'Crop' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -crop '80x80+25+50' -label Crop ${OUTFILE}

OUTFILE=TileDespeckle_out.miff
rm -f ${OUTFILE}
test_command_fn 'Despeckle' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -despeckle -label Despeckle ${OUTFILE}

OUTFILE=TileDraw_out.miff
DRAWFILE=draw_circle_out.txt
rm -f ${OUTFILE}
echo 'circle 60,90 60,120' > ${DRAWFILE}
test_command_fn 'Draw' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -fill none -stroke gold \
         -draw @${DRAWFILE} -label Draw ${OUTFILE}
rm -f ${DRAWFILE}

OUTFILE=TileEdge_out.miff
rm -f ${OUTFILE}
test_command_fn 'Edge' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -edge 0x1 -label Edge ${OUTFILE}

OUTFILE=TileEmboss_out.miff
rm -f ${OUTFILE}
test_command_fn 'Emboss' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -emboss 0x1 -label Emboss ${OUTFILE}

OUTFILE=TileEqualize_out.miff
rm -f ${OUTFILE}
test_command_fn 'Equalize' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -equalize -label Equalize ${OUTFILE}

OUTFILE=TileExplode_out.miff
rm -f ${OUTFILE}
test_command_fn 'Explode' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -implode -1 -label Explode ${OUTFILE}

OUTFILE=TileFlip_out.miff
rm -f ${OUTFILE}
test_command_fn 'Flip' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -flip -label Flip ${OUTFILE}

OUTFILE=TileFlop_out.miff
rm -f ${OUTFILE}
test_command_fn 'Flop' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -flop -label Flop ${OUTFILE}

OUTFILE=TileFrame_out.miff
rm -f ${OUTFILE}
test_command_fn 'Frame' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -frame 15x15+3+3 -label Frame ${OUTFILE}

OUTFILE=TileGamma_out.miff
rm -f ${OUTFILE}
test_command_fn 'Gamma' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -gamma 1.6 -label Gamma ${OUTFILE}

OUTFILE=TileGaussianBlur_out.miff
rm -f ${OUTFILE}
test_command_fn 'GaussianBlur' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -gaussian 0x1.5 -label GaussianBlur ${OUTFILE}

OUTFILE=TileGradient_out.miff
rm -f ${OUTFILE}
test_command_fn 'Gradient' ${GM} convert ${CONVERT_FLAGS} -size 130x194 gradient:'#20a0ff-#ffff00' -label Gradient ${OUTFILE}

OUTFILE=TileGrayscale_out.miff
rm -f ${OUTFILE}
test_command_fn 'Grayscale' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -colorspace gray -label Grayscale ${OUTFILE}

OUTFILE=TileImplode_out.miff
rm -f ${OUTFILE}
test_command_fn 'Implode' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -implode 0.5 -label Implode ${OUTFILE}

OUTFILE=TileLevel_out.miff
rm -f ${OUTFILE}
test_command_fn 'Level' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -level 10%,1.2,90% -label Level ${OUTFILE}

rm -f mask_out.miff TileMask_out.miff
${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -threshold "30%" mask_out.miff
test_command_fn 'Mask' ${GM} convert ${CONVERT_FLAGS} -mask mask_out.miff ${MODEL_MIFF} -negate -label Mask TileMask_out.miff

OUTFILE=TileMedian_out.miff
rm -f ${OUTFILE}
test_command_fn 'MedianFilter' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -median 3 -label MedianFilter ${OUTFILE}

OUTFILE=TileModulate_out.miff
rm -f ${OUTFILE}
test_command_fn 'Modulate' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -modulate 110/110/110 -label Modulate ${OUTFILE}

OUTFILE=TileMonochrome_out.miff
rm -f ${OUTFILE}
test_command_fn 'Monochrome' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -colorspace gray -colors 2 \
                   +dither -label Monochrome ${OUTFILE}

OUTFILE=TileNegate_out.miff
rm -f ${OUTFILE}
test_command_fn 'Negate' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -negate -label Negate ${OUTFILE}

OUTFILE=TileNormalize_out.miff
rm -f ${OUTFILE}
test_command_fn 'Normalize' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -normalize -label Normalize ${OUTFILE}

OUTFILE=TileOilPaint_out.miff
rm -f ${OUTFILE}
test_command_fn 'Oilpaint' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -paint 0x1 -label Oilpaint ${OUTFILE}

OUTFILE=TileOrderedDither2_out.miff
rm -f ${OUTFILE}
test_command_fn 'Ordered2x2' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -equalize -ordered-dither intensity 2x2 -label Ordered2x2 ${OUTFILE}

OUTFILE=TileOrderedDither3_out.miff
rm -f ${OUTFILE}
test_command_fn 'Ordered3x3' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -equalize -ordered-dither intensity 3x3 -label Ordered3x3 ${OUTFILE}

OUTFILE=TileOrderedDither4_out.miff
rm -f ${OUTFILE}
test_command_fn 'Ordered4x4' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -equalize -ordered-dither intensity 4x4 -label Ordered4x4 ${OUTFILE}

OUTFILE=TilePlasma_out.miff
rm -f ${OUTFILE}
test_command_fn 'Plasma' ${GM} convert ${CONVERT_FLAGS} -size 130x194 plasma:fractal -label Plasma ${OUTFILE}

OUTFILE=TileQuantize_out.miff
rm -f ${OUTFILE}
test_command_fn 'Quantize' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -colors 16 -label Quantize ${OUTFILE}

OUTFILE=TileRaise_out.miff
rm -f ${OUTFILE}
test_command_fn 'Raise' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -raise 10x10 -label Raise ${OUTFILE}

OUTFILE=TileRandomThreshold_out.miff
rm -f ${OUTFILE}
test_command_fn 'Random 10%' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -equalize -random-threshold intensity '10%' -label 'Random10%%' ${OUTFILE}

OUTFILE=TileRecolor_out.miff
MATRIXFILE=recolor_matrix_out.txt
echo '0.9 0 0, 0 0.9 0, 0 0 1.2' > ${MATRIXFILE}
rm -f ${OUTFILE}
test_command_fn 'Recolor' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -recolor @${MATRIXFILE} -label Recolor ${OUTFILE}
rm -f ${MATRIXFILE}

OUTFILE=TileReduceNoise_out.miff
rm -f ${OUTFILE}
test_command_fn 'ReduceNoise' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -noise 0x1 -label ReduceNoise ${OUTFILE}

OUTFILE=TileResize_out.miff
rm -f ${OUTFILE}
test_command_fn 'Resize' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -resize 50% -label Resize ${OUTFILE}

OUTFILE=TileRoll_out.miff
rm -f ${OUTFILE}
test_command_fn 'Roll' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -roll +20+10 -label Roll ${OUTFILE}

OUTFILE=TileRotate_out.miff
rm -f ${OUTFILE}
test_command_fn 'Rotate 45' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -fill black -rotate 45 \
        -transparent black -label Rotate ${OUTFILE}

OUTFILE=TileScale_out.miff
rm -f ${OUTFILE}
test_command_fn 'Scale' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -scale 60% -label Scale ${OUTFILE}

OUTFILE=TileSegment_out.miff
rm -f ${OUTFILE}
test_command_fn 'Segment' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -segment 0.5x0.25 -label Segment ${OUTFILE}

OUTFILE=TileShade_out.miff
rm -f ${OUTFILE}
test_command_fn 'Shade' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -shade 30x30 -label Shade ${OUTFILE}

OUTFILE=TileSharpen_out.miff
rm -f ${OUTFILE}
test_command_fn 'Sharpen' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -sharpen 0x1 -label Sharpen ${OUTFILE}

OUTFILE=TileShave_out.miff
rm -f ${OUTFILE}
test_command_fn 'Shave' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -shave 10x10 -label Shave ${OUTFILE}

OUTFILE=TileShear_out.miff
rm -f ${OUTFILE}
test_command_fn 'Shear' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -fill black -shear 45x45 \
        -transparent black -label Shear ${OUTFILE}

OUTFILE=TileSolar_out.miff
rm -f ${OUTFILE}
test_command_fn 'Solarize' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -solarize 50% -label Solarize ${OUTFILE}

OUTFILE=TileSpread_out.miff
rm -f ${OUTFILE}
test_command_fn 'Spread' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -spread 3 -label Spread ${OUTFILE}

OUTFILE=TileSwirl_out.miff
rm -f ${OUTFILE}
test_command_fn 'Swirl' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -background '#000000FF' \
        -swirl 90 -label Swirl ${OUTFILE}

OUTFILE=TileThreshold_out.miff
rm -f ${OUTFILE}
test_command_fn 'Threshold' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -threshold "35%" \
                   -label Threshold ${OUTFILE}

OUTFILE=TileUnsharpMask_out.miff
rm -f ${OUTFILE}
test_command_fn 'UnsharpMask' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -unsharp 0x1+10+10 -label UnsharpMask ${OUTFILE}

OUTFILE=TileWave_out.miff
rm -f ${OUTFILE}
test_command_fn 'Wave' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -background '#000000FF' \
        -wave 25x150 -label Wave ${OUTFILE}

OUTFILE=TileThresholdWhite_out.miff
rm -f ${OUTFILE}
test_command_fn 'White-Threshold' ${GM} convert ${CONVERT_FLAGS} ${MODEL_MIFF} -white-threshold "80%" \
                   -label 'White-Threshold' ${OUTFILE}
: