Imagemagick operators page: 19

Transparent inverted

Make all colours except this color transparent within the image.

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

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

Transpose

Mirror the image along the top-left to bottom-right diagonal.

Transpose example
<?php 
$cmd 
"$input -transpose"
exec("convert $cmd transpose.jpg");
 
?>

Transverse

Mirror the image along the images bottom-left top-right diagonal.

Transverse example
<?php 
$cmd 
"$input -transverse"
exec("convert $cmd transverse.jpg");
 
?>

Treedepth

Tree depth for the color reduction algorithm.

More information to follow.

Trim

Trim an image.

Trim example
<?php 
$cmd 
"strokewidth.jpg -trim "
exec("convert $cmd trim.png");
 
?>

( -fuzz can be added if the the border colour varies slightly. )

Type

The image type.

Type example
<?php 
$cmd 
"$input -type Grayscale";  
exec("convert $cmd type.jpg");
  
?>

( Choose from: Bilevel, Grayscale, GrayscaleMatte, Palette, PaletteMatte, TrueColor, TrueColorMatte, ColorSeparation, or ColorSeparationMatte. )

Undercolor

Set the color of the annotation bounding box.

Undercolor example
<?php 
$cmd 
"$input -fill Black -pointsize 40 -gravity center"
" -undercolor NavajoWhite -annotate +0+0 \"Undercolor\""
exec("convert $cmd undercolor.jpg");
 
?>

Unique colors

Discard all but one of any pixel color from the image.

Unique colors example
<?php 
$cmd 
"$input4 -unique-colors -resize x20"
exec("convert $cmd unique_colors.jpg");
 
?>

( Will create an image 1px high and VERY wide if your image contains a lot of colours. I have resized the height to 20px to see the colours. )

Units

The units of image resolution.

Units example
<?php 
$cmd 
"$input -density 200x200".
" -units PixelsPerInch";  
exec("convert $cmd units.jpg");
  
?>

Unsharp

Sharpen the image with an unsharp mask operator.

Unsharp example
<?php 
$cmd 
"$input -unsharp 1.5"
exec("convert $cmd unsharp_simple.jpg");
 
?>

Update

Detect when image file is modified and redisplay.

Not used with php

Verbose

Print detailed information about the image when this option preceds the -identify option or info:

Image: input.jpg
Format: JPEG (Joint PhotographicExperts Group JFIF format)
Class: DirectClass
Geometry: 266x200+0+0
Resolution: 72x72
Print size: 3.69444x2.77778


<?php 
system
("convert $input -verbose -identify ");
  
?>

( Will output an A4 size sheet of information about an image. )

Version

Print ImageMagick version.

Version: ImageMagick 6.7.3-6 2011-11-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC

Features: OpenMP

<?php 
echo "<pre>"
system("convert -version");   
echo 
"</pre>";
   
?>

( As we want the version displayed use system not exec. )

View

FlashPix viewing parameters.

Not used with php.