Imagemagick operators page: 8

Fill

Color to use when filling a graphic primitive.

Fill example
<?php 
$cmd 
"$input -fill blue -fuzz \"10%\""
" -opaque \"#7b1216\" "
exec("convert $cmd fill.jpg");
 
?>

Filter

Filter to be used during resize.

Check this page for some examples of the filters


( The standard filter is Lanczos. )

Flatten

This is a simple alias for the -layers method "flatten".

Flatten example
<?php 
$cmd 
"-size 213x160 -background NavajoWhite -fill black"
" -gravity center caption:\"Flatten\" -flatten"
exec("convert $cmd flatten.jpg");
 
?>

Flip

Create a mirror image.

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

Floodfill

Floodfill the image with color at the specified offset.

Floodfill example
<?php 
$cmd 
"$input -fill Blue -fuzz \"25%\" -floodfill +80+30 "
" \"#7b1216\""
exec("convert $cmd floodfill.jpg");
 
?>

( Using -fuzz to floodfill pixels which only change by a small amount. )

Flop

Reflect the image in the horizontal direction.

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

Font

Set the font to be used with draw, annotate etc.

Font example
<?php 
$cmd 
"$input -font handsean.ttf -pointsize 40 "
"-fill white -gravity south -annotate 0,0 \"Draw text\" "
exec("convert $cmd font.jpg");
 
?>

( You can use a font recognised by Imagemagick or provide the path to a font. )

Foreground

Define the foreground color.

Not used with php.

Format

Output formatted image characteristics.

Format example
<?php 
$time_stamp 
exec("identify -format \"%[EXIF:DateTime]\" $input"); 
$cmd "$input -pointsize 18 -gravity north "
" -fill black -annotate +2+2 \"Date: $time_stamp\"  "
" -fill white -annotate +0+0 \"Date: $time_stamp\"  "
exec("convert $cmd format.jpg"); 

$pi exec("convert null: -format \"PI=%[fx:atan(1)*4]\" info:"); 
echo 
$pi;
// Result - PI=3.14159
 
?>

Frame

A frame around the image

Frame example
<?php 
$cmd 
"$input -mattecolor NavajoWhite -frame 10x10+3+3"
exec("convert $cmd frame.jpg");
 
?>

( Set the frame color with -mattecolor. The image size will increase by the frame size. )

Function

Apply a function to channel values.

Function example
<?php 
$cmd 
"$input -channel R -function Sinusoid 3,-90,.2,.7"
exec("convert $cmd Sinusoid.jpg");
 
?>

( Add another example http://www.imagemagick.org/Usage/color/#curves )

Fuzz

Fuzz can be used to select a range of colours and in the example is used with transparent.

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

( Image displayed on a grey checkerboard to show the transparent areas.
IS IT ? )

Fx

The Fx special effects image operator is used to apply a mathematical expression to an image or image channels.

Fx example
<?php 
$cmd 
"$input -fx \"(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503\" "
exec("convert $cmd fx.jpg");
 
?>

Gamma

Level of gamma correction.

Gamma example
<?php 
$cmd 
"$input -gamma 0.8 "
exec("convert $cmd gamma.jpg");
 
?>