Imagemagick operators page: 11

Linear stretch

Linear with saturation stretch.

Linear stretch example
<?php 
$cmd 
"$input -linear-stretch 1,2% ";  
exec("convert $cmd linear_stretch.jpg");
 
?>

Linewidth

Linewidth is depreciated use strokewidth.

Linewidth example
<?php 
$cmd 
"$input -stroke black -linewidth 5"
" -fill none -draw \"circle 120,80 120,15 \" "
exec("convert $cmd linewidth.jpg");
  
?>

Liquid rescale

Rescale image with seam-carving.

Liquid rescale example
<?php 
$cmd 
"$input -liquid-rescale \"75x100%\!\" "
exec("convert $cmd liquid_rescale.jpg");
 
?>

( Not built in extra code needs to be built into IM. )

List

List some operator options

All the gravity options

None
Center
East
Forget
NorthEast
North
NorthWest
SouthEast
South
SouthWest
West
Static

<?php 
echo "All the gravity options<br><pre>"
system("convert -list gravity");  
echo 
"</pre>";
  
?>

Log

Specify the format for the debug log.

First few lines of output

<?php $array = array(); 
echo 
"<pre>";
$cmd " -debug coder -log \"%u %m:%l %e\" $input ";
exec("convert $cmd log.jpg 2>&1"$array);  
echo 
"<br>".print_r($array)."<br>";  
echo 
"</pre>"?>

( Array ( [0] => 0.016u jpeg.c:336 [images/input.jpg] JPEG Trace: "Start of Image" [1] => 0.016u jpeg.c:336 [images/input.jpg] JPEG Trace: "JFIF APP0 marker: version 1.01, density 72x72 1" [2] => 0.016u jpeg.c:667 Profile: exif, 11764 bytes )

Loop

Add Netscape loop extension to your GIF animation.

Loop example
<?php 
$cmd 
" -dispose previous -delay 5 -size 213x160 xc:none -page +0+0 $input4"
" -page +10+15 $input4 -page +20+30 $input4 -page +30+45 $input4"
" -page +40+60 $input4 -page +50+75 $input4 -page +60+90 $input4"
" -page +70+75 $input4 -page +80+60 $input4"
" -page +90+45 $input4 -page +100+30 $input4 -page +110+15 $input4"
" -page +120+0 $input4 -loop 0"
exec("convert $cmd loop.gif");
      
?>

Lowlight color

When comparing images, de-emphasize pixel differences with this color.

More information to follow.

Magnify

magnify the image.

Not used with php

Map

Display image using a specified type.

More information to follow.


( Used with animations.
+map generate a colour map
-map use a colour map
)

Mask

Composite the image pixels as defined by the mask.

More information to follow.

Mattecolor

Sets the color for -frame

Mattecolor example
<?php 
$cmd 
"$input -mattecolor lightbrown -frame 10x10+0+0"
exec("convert $cmd mattecolor.jpg");
  
?>

Median

Apply a median filter to the image.

Median example
<?php 
$cmd 
"$input -median 1"
exec("convert $cmd median.jpg");
 
?>

Metric

Output to STDERR a measure of the differences between images according to the type given metric.

8.11889

<?php 
system
("compare -metric PSNR monochrome.jpg emboss.jpg difference.png 2>&1");
 
?>

Mode

Mode of operation.

More information to follow.