Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/magick/testcmds.rc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

if(~ $#* 1) out=$1
if not out=miff

MAGICK_CONFIGURE_PATH=./config

composite=./$O.composite
convert=./$O.convert
montage=./$O.montage

mmiff=./demo/model.miff
smiff=./demo/smile.miff
gfont=./demo/Generic.ttf

echo Testing addnoise...
$convert $mmiff +noise Laplacian -label AddNoise AddNoise_fgb.$out

echo Testing annotate...
$convert $mmiff -fill gold -pointsize 14 -font $gfont -draw 'gravity North text 0,20 "FGB"' -label Annotate Annotate_fgb.$out

echo Testing blur...
$convert $mmiff -blur 0x1 -label Blur Blur_fgb.$out

echo Testing border...
$convert $mmiff -bordercolor gold -border 6x6 -label Border Border_fgb.$out

echo Testing channel...
$convert $mmiff -label Channel Channel_fgb.$out

echo Testing charcoal...
$convert $mmiff -charcoal 0x1 -label Charcoal Charcoal_fgb.$out

echo Testing composite...
$composite $smiff -geometry +35+65 $mmiff -label Composite Comp_fgb.$out

echo Testing contrast...
$convert $mmiff -contrast -label Contrast Contrast_fgb.$out

echo Testing convolve...
$convert $mmiff -convolve 1,1,1,1,4,1,1,1,1 -label Convolve Convolve_fgb.$out

echo Testing crop...
$convert $mmiff -crop '80x80+25+50' -label Crop Crop_fgb.$out

echo Testing despeckle...
$convert $mmiff -despeckle -label Despeckle Despeckle_fgb.$out

echo Testing draw...
$convert $mmiff -fill none -stroke gold -draw 'circle 60,90 60,120' -label Draw Draw_fgb.$out

echo Testing edge...
$convert $mmiff -edge 0x1 -label Edge Edge_fgb.$out

echo Testing emboss...
$convert $mmiff -emboss 0x1 -label Emboss Emboss_fgb.$out

echo Testing equalize...
$convert $mmiff -equalize -label Equalize Equalize_fgb.$out

echo Testing explode...
$convert $mmiff -implode -1 -label Explode Explode_fgb.$out

echo Testing flip...
$convert $mmiff -flip -label Flip Flip_fgb.$out

echo Testing flop...
$convert $mmiff -flop -label Flop Flop_fgb.$out

echo Testing frame...
$convert $mmiff -frame 15x15+3+3 -label Frame Frame_fgb.$out

echo Testing gamma...
$convert $mmiff -gamma 1.6 -label Gamma Gamma_fgb.$out

echo Testing gaussianblur...
$convert $mmiff -gaussian 0x1.5 -label GaussianBlur GB_fgb.$out

echo Testing gradient...
$convert -size 130x194 gradient:'#20a0ff-#ffff00' -label Gradient Gradient_fgb.$out

echo Testing grayscale...
$convert $mmiff -colorspace gray -label Grayscale Grayscale_fgb.$out

echo Testing implode...
$convert $mmiff -implode 0.5 -label Implode Implode_fgb.$out

echo Testing level...
$convert $mmiff -level 20% -label Level Level_fgb.$out

echo Testing medianfilter...
$convert $mmiff -median 3 -label MedianFilter Median_fgb.$out

echo Testing modulate...
$convert $mmiff -modulate 110/110/110 -label Modulate Mod_fgb.$out

echo Testing monochrome...
$convert $mmiff -colorspace gray -colors 2 +dither -label Monochrome Mono_fgb.$out

echo Testing montage...
$montage null: null: null: null: null: 'tmp:[A-Z]*_fgb.'$out -geometry '130x194+10+5>' -gravity 'Center' -bordercolor 'green' -border 1x1 -tile '5x' -background '#ffffff' -font $gfont -pointsize 18 -fill '#600' -stroke 'none' -compress rle montage_fgb.$out
$convert logo: -resize 40% logo_fgb.$out
$composite tmp:logo_fgb.$out -gravity north tmp:montage_fgb.$out demo.$out

echo Testing negate...
$convert $mmiff -negate -label Negate Negate_fgb.$out

echo Testing normalize...
$convert $mmiff -normalize -label Normalize Normal_fgb.$out

echo Testing oilpaint...
$convert $mmiff -paint 0x1 -label Oilpaint Oil_fgb.$out

echo Testing ordered-dither2x2...
$convert $mmiff -equalize -ordered-dither 2x2 -label Ordered2x2 Ordered2_fgb.$out

echo Testing ordered-dither3x3...
$convert $mmiff -equalize -ordered-dither 3x3 -label Ordered3x3 Ordered3_fgb.$out

echo Testing ordered-dither4x4...
$convert $mmiff -equalize -ordered-dither 4x4 -label Ordered4x4 Ordered4_fgb.$out

echo Testing plasma...
$convert -size 130x194 plasma:fractal -label Plasma Plasma_fgb.$out

echo Testing quantize...
$convert $mmiff -label Quantize Quantize_fgb.$out

echo Testing raise...
$convert $mmiff -raise 10x10 -label Raise Raise_fgb.$out

echo Testing random-threshold...
$convert $mmiff -equalize -random-threshold '10%' -label 'Random10%%' Random10_fgb.$out

echo Testing reducenoise...
$convert $mmiff -noise 0x1 -label ReduceNoise RedN_fgb.$out

echo Testing resize...
$convert $mmiff -resize 50% -label Resize Resize_fgb.$out

echo Testing roll...
$convert $mmiff -roll +20+10 -label Roll Roll_fgb.$out

echo Testing rotate...
$convert $mmiff -fill black -rotate 45 -transparent black -label Rotate Rotate_fgb.$out

echo Testing scale...
$convert $mmiff -scale 60% -label Scale Scale_fgb.$out

echo Testing segment...
$convert $mmiff -segment 1x1.5 -label segment Segment_fgb.$out

echo Testing shade...
$convert $mmiff -shade 30x30 -label Shade Shade_fgb.$out

echo Testing sharpen...
$convert $mmiff -sharpen 0x1 -label Sharpen Sharpen_fgb.$out

echo Testing shave...
$convert $mmiff -shave 10x10 -label Shave Shave_fgb.$out

echo Testing shear...
$convert $mmiff -fill black -shear 45x45 -transparent black -label Shear Shear_fgb.$out

echo Testing solarize...
$convert $mmiff -solarize 50% -label Solarize Solar_fgb.$out

echo Testing spread...
$convert $mmiff -spread 3 -label Spread Spread_fgb.$out

echo Testing swirl...
$convert $mmiff -background '#000000FF' -swirl 90 -label Swirl Swirl_fgb.$out

echo Testing unsharpmask...
$convert $mmiff -unsharp 0x1 -label UnsharpMask Unsharp_fgb.$out

echo Testing wave...
$convert $mmiff -background '#000000FF' -wave 25x150 -label Wave Wave_fgb.$out

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].