Imagemagick operators page: 18

Swap

Swap the positions of two images in the image sequence.

Swap example
<?php 
$cmd 
"$input1 $input +swap -gravity center"
" -composite ";  
exec("convert $cmd swap.jpg");
 
?>

Swirl

Swirl image pixels about the center.

Swirl example
<?php 
$cmd 
"$input -swirl 80"
exec("convert $cmd swirl.jpg");
 
?>

Taint

Mark the image as modified even if it isn't.

More information to follow.

Text font

Font for writing fixed-width text.

More information to follow.

<?php 
$cmd 
"$input -fill white -pointsize 40"" -gravity center -text-font Arial ".
" -annotate +0+0 \"Text font\""
exec("convert $cmd text-font.jpg");
 
?>

Texture

Name of texture to tile onto the image background.

Texture example
<?php 
$cmd 
" -size 313x260 pattern:BRICKS ".
$input -gravity center -composite ""-resize 213 ";
exec("convert $cmd texture.jpg");
  
?>

( The bricks texture is one built into Imagemagick. )

Threshold

Apply simultaneous black/white threshold to the image.

Threshold example
<?php 
$cmd 
"$input -channel red -threshold 25%";
exec("convert $cmd threshold.jpg");
 
?>

Thumbnail

Resize and thumbnail have the same effect but thumbnail strips the EXIF data etc.

Thumbnail example
<?php 
$cmd 
"$input -thumbnail 50% "
exec("convert $cmd thumbnail.jpg");
 
?>

( Later versions do not strip the colour profile. )

Tile

Set the tile image used for filling a subsequent graphic primitive.

Tile example
<?php 
// Resize the boots image first to fit image
exec("convert $input1 -thumbnail 50x50 temp.png");
// Tile the image
$cmd "-tile temp.png $input ";  
exec("composite $cmd tile.jpg");
 
?>

( As this example is using composite rather than convert the images are in reverse order. )

Tile offset

Specify the offset for tile images, relative to the background image it is tiled on.

Tile offset example
<?php 
exec
("convert $input1 -thumbnail 50x50 temp.png");
// Tile the image
$cmd " -size 213x160 -tile-offset +10+10 tile:temp.png ";  
exec("convert $cmd tile_offset.jpg");  ?>

( This is the offset from the datum position NOT the offset between the tiles. The default position is the top left corner. )

Tint

Tint the image with the fill color.

Tint example
<?php 
$cmd 
"$input -fill Blue -tint 30"
exec("convert $cmd tint.jpg");
 
?>

Title

Assign a title to displayed image.

Not used with php

Transform

Transform the image.

This operator has been now been superseded by the -distort 'AffineProjection' method.

Transparent

Make this color transparent within the image.

Transparent example
<?php 
$cmd 
"$input -fuzz 10% -transparent #7b1216 "
exec("convert $cmd transparent.png");
 
?>

( Save as a png to retain the transparency. -fuzz can be used to select a range of colours.
Also see Transparent inverted )

Transparent color

Set the transparent colour.

Transparent color example
<?php 
$cmd 
"$input -transparent-color Black"
exec("convert $cmd transparent_color.jpg");
 
?>

( This does not make a colour transparent, it only defines what colour the transparent colour is in the colour palette of the saved image. )