©
本文檔使用 php中文網手册 發布
(PECL imagick 2.0.0)
$radius
, float $sigma
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$columns
, int $rows
[, bool $bestfit
= false
] )$radius
, float $sigma
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$width
, int $height
, int $offset
)$source
)$noise_type
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$matrix
)$x_server
)$draw_settings
, float $x
, float $y
, float $angle
, string $text
)$stack
= false
)$CHANNEL
= Imagick::CHANNEL_DEFAULT
] )$threshold
)$factor
= 1.5
] )$radius
, float $sigma
[, int $channel
] )$bordercolor
, int $width
, int $height
)$brightness
, string $contrast
[, string $CHANNEL
= Imagick::CHANNEL_DEFAULT
] )$radius
, float $sigma
)$width
, int $height
, int $x
, int $y
)$CHANNEL
= Imagick::CHANNEL_DEFAULT
] )$pathname
, string $inside
)$pathname
, bool $inside
)$lookup_table
[, float $channel
= Imagick::CHANNEL_DEFAULT
] )$fill
, float $fuzz
, mixed $bordercolor
, int $x
, int $y
)$colorize
, mixed $opacity
)$color_matrix
= Imagick::CHANNEL_DEFAULT
)$channelType
)$comment
)$image
, int $channelType
, int $metricType
)$method
)$compare
, int $metric
)$composite_object
, int $composite
, int $x
, int $y
[, int $channel
= Imagick::CHANNEL_ALL
] )$files
)$sharpen
)$black_point
, float $white_point
[, int $channel
= Imagick::CHANNEL_ALL
] )$kernel
[, int $channel
= Imagick::CHANNEL_ALL
] )$mode
] )$width
, int $height
, int $x
, int $y
)$width
, int $height
)$displace
)$passphrase
)$artifact
)$name
)$threshold
)$servername
)$servername
)$method
, array $arguments
, bool $bestfit
)$draw
)$radius
)$radius
, float $sigma
)$passphrase
)$op
, float $constant
[, int $channel
= Imagick::CHANNEL_ALL
] )$x
, int $y
, int $width
, int $height
, string $map
, int $STORAGE
)$width
, int $height
, int $x
, int $y
)$ImagickKernel
[, int $CHANNEL
= Imagick::CHANNEL_DEFAULT
] )$fill
, float $fuzz
, mixed $target
, int $x
, int $y
, bool $invert
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$magnitude
)$matte_color
, int $width
, int $height
, int $inner_bevel
, int $outer_bevel
)$function
, array $arguments
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$expression
[, int $channel
= Imagick::CHANNEL_ALL
] )$gamma
[, int $channel
= Imagick::CHANNEL_ALL
] )$radius
, float $sigma
[, int $channel
= Imagick::CHANNEL_ALL
] )$artifact
)$key
)$channel
)$reference
, int $channel
, int $metric
)$reference
, int $metric
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$channel
)$channel
= Imagick::CHANNEL_DEFAULT
] )$channel
)$channel
)$index
)$reference
, int $metric
)$x
, int $y
)$name
)$pattern
= "*"
[, bool $only_names
= true
]] )$pattern
= "*"
[, bool $only_names
= true
]] )$name
)$width
, int $height
, int $x
, int $y
)$key
)$x
, int $y
, int $columns
, int $rows
)$key
)$type
)$type
)$clut
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$embedText
)$appendRawOutput
= false
] )$radius
)$x
, int $y
, int $width
, int $height
, string $map
, int $storage
, array $pixels
)$complement
, string $magnitude
)$label
)$blackPoint
, float $gamma
, float $whitePoint
[, int $channel
= Imagick::CHANNEL_ALL
] )$blackPoint
, float $whitePoint
)$width
, int $height
, float $delta_x
, float $rigidity
)$map
, bool $dither
)$alpha
, float $fuzz
, mixed $bordercolor
, int $x
, int $y
)$radius
)$layer_method
)$brightness
, float $saturation
, float $hue
)$draw
, string $tile_geometry
, string $thumbnail_geometry
, int $mode
, string $frame
)$number_frames
)$morphologyMethod
, int $iterations
, ImagickKernel $ImagickKernel
[, string $CHANNEL
] )$radius
, float $sigma
, float $angle
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$gray
[, int $channel
= Imagick::CHANNEL_ALL
] )$cols
, int $rows
, mixed $background
[, string $format
] )$columns
, int $rows
, string $pseudoString
)$channel
= Imagick::CHANNEL_ALL
] )$radius
)$target
, mixed $fill
, float $fuzz
, bool $invert
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$threshold_map
[, int $channel
= Imagick::CHANNEL_ALL
] )$fill
, float $fuzz
, mixed $bordercolor
, int $x
, int $y
[, int $channel
= Imagick::CHANNEL_ALL
] )$target
, mixed $fill
, float $fuzz
[, int $channel
= Imagick::CHANNEL_ALL
] )$target
, float $alpha
, float $fuzz
)$filename
)$image
)$filehandle
[, string $fileName
] )$properties
, float $angle
)$levels
, bool $dither
)$preview
)$name
, string $profile
)$numberColors
, int $colorspace
, int $treedepth
, bool $dither
, bool $measureError
)$numberColors
, int $colorspace
, int $treedepth
, bool $dither
, bool $measureError
)$properties
, string $text
[, bool $multiline
] )$pattern
= "*"
] )$pattern
= "*"
] )$angle
[, int $channel
= Imagick::CHANNEL_ALL
] )$width
, int $height
, int $x
, int $y
, bool $raise
)$low
, float $high
[, int $channel
= Imagick::CHANNEL_ALL
] )$filename
)$image
[, string $filename
] )$filehandle
[, string $fileName
= null
] )$filenames
)$matrix
)$radius
)$replacement
, int $DITHER
)$name
)$x_resolution
, float $y_resolution
, int $filter
, float $blur
)$page
)$columns
, int $rows
, int $filter
, float $blur
[, bool $bestfit
= false
] )$x
, int $y
)$background
, float $degrees
)$angle
[, string $CHANNEL
= Imagick::CHANNEL_DEFAULT
] )$x_rounding
, float $y_rounding
[, float $stroke_width
= 10
[, float $displace
= 5
[, float $size_correction
= -6
]]] )$columns
, int $rows
)$cols
, int $rows
[, bool $bestfit
= false
] )$COLORSPACE
, float $cluster_threshold
, float $smooth_threshold
[, bool $verbose
= false
] )$radius
, float $sigma
, float $threshold
, int $CHANNEL
)$channel
)$threshold
)$background
)$COLORSPACE
)$compression
)$quality
)$filename
)$font
)$format
)$gravity
)$replace
)$mode
)$artifact
, string $value
)$key
, string $value
)$background
)$bias
)$bias
)$x
, float $y
)$border
)$channel
, int $depth
)$clip_mask
)$index
, ImagickPixel $color
)$colorspace
)$compose
)$compression
)$quality
)$delay
)$depth
)$dispose
)$columns
, int $rows
)$filename
)$format
)$gamma
)$gravity
)$x
, float $y
)$index
)$interlace_scheme
)$method
)$iterations
)$matte
)$matte
)$opacity
)$orientation
)$width
, int $height
, int $x
, int $y
)$name
, string $profile
)$name
, string $value
)$x
, float $y
)$rendering_intent
)$x_resolution
, float $y_resolution
)$scene
)$ticks_per_second
)$image_type
)$units
)$method
)$x
, float $y
)$interlace_scheme
)$index
)$key
, string $value
)$width
, int $height
, int $x
, int $y
)$point_size
)$callback
)$key
, string $value
)$x_resolution
, float $y_resolution
)$type
, int $limit
)$factors
)$columns
, int $rows
)$columns
, int $rows
, int $offset
)$image_type
)$gray
, float $azimuth
, float $elevation
)$opacity
, float $sigma
, int $x
, int $y
)$radius
, float $sigma
[, int $channel
= Imagick::CHANNEL_ALL
] )$columns
, int $rows
)$background
, float $x_shear
, float $y_shear
)$sharpen
, float $alpha
, float $beta
[, int $channel
= Imagick::CHANNEL_ALL
] )$radius
, float $sigma
, float $angle
)$stack
, string $offset
)$threshold
)$SPARSE_METHOD
, array $arguments
[, int $channel
= Imagick::CHANNEL_DEFAULT
] )$width
, int $height
, int $x
, int $y
)$radius
)$type
, int $width
, int $height
[, string $CHANNEL
= Imagick::CHANNEL_DEFAULT
] )$watermark_wand
, int $offset
)$offset_wand
)$Imagick
[, array &$offset
[, float &$similarity
]] )$degrees
)$texture_wand
)$threshold
[, int $channel
= Imagick::CHANNEL_ALL
] )$columns
, int $rows
[, bool $bestfit
= false
[, bool $fill
= false
]] )$tint
, mixed $opacity
)$crop
, string $geometry
)$colorspace
)$target
, float $alpha
, float $fuzz
, bool $invert
)$fuzz
)$radius
, float $sigma
, float $amount
, float $threshold
[, int $channel
= Imagick::CHANNEL_ALL
] )$blackPoint
, float $whitePoint
, int $x
, int $y
)$amplitude
, float $length
)$threshold
)$filename
= NULL
] )$filehandle
)$filename
, bool $adjoin
)$filehandle
)The Imagick class has the ability to hold and operate on multiple images simultaneously. This is achieved through an internal stack. There is always an internal pointer that points at the current image. Some functions operate on all images in the Imagick class, but most operate only on the current image in the internal stack. As a convention, method names can contain the word Image to denote they affect only the current image in the stack.
Because there are so many methods, here is a handy list of methods, somewhat reduced to their general purpose:
Image effects | Get methods | Set methods | Read/write images | Other |
---|---|---|---|---|
Imagick::adaptiveBlurImage() | Imagick::getCompression() | Imagick::setBackgroundColor() | Imagick::__construct() | Imagick::clear() |
Imagick::adaptiveResizeImage() | Imagick::getFilename() | Imagick::setCompressionQuality() | Imagick::addImage() | Imagick::clone() |
Imagick::adaptiveSharpenImage() | Imagick::getFormat() | Imagick::setCompression() | Imagick::appendImages() | Imagick::current() |
Imagick::adaptiveThresholdImage() | Imagick::getImageBackgroundColor() | Imagick::setFilename() | Imagick::getFilename() | Imagick::destroy() |
Imagick::addNoiseImage() | Imagick::getImageBlob() | Imagick::getImagesBlob() | Imagick::setFormat() | Imagick::getFormat() |
Imagick::affinetransformimage() | Imagick::getImageBluePrimary() | Imagick::setImageBackgroundColor() | Imagick::getImageFilename() | Imagick::getHomeURL() |
Imagick::annotateImage() | Imagick::getImageBorderColor() | Imagick::setFirstIterator() | Imagick::getImageFormat() | Imagick::commentImage() |
Imagick::averageImages() | Imagick::getImageChannelDepth() | Imagick::setImageBias() | Imagick::getImage() | Imagick::getNumberImages() |
Imagick::blackThresholdImage() | Imagick::getImageChannelDistortion() | Imagick::setImageBluePrimary() | Imagick::setImageFilename() | Imagick::getReleaseDate() |
Imagick::blurImage() | Imagick::getImageChannelExtrema() | Imagick::setImageBorderColor() | Imagick::setImageFormat() | Imagick::getVersion() |
Imagick::borderImage() | Imagick::getImageChannelMean() | Imagick::setImageChannelDepth() | Imagick::readImageFile() | Imagick::hasNextImage() |
Imagick::charcoalImage() | Imagick::getImageChannelStatistics() | Imagick::setImageColormapColor() | Imagick::readImage() | Imagick::hasPreviousImage() |
Imagick::chopImage() | Imagick::getImageColormapColor() | Imagick::setImageColorSpace() | Imagick::writeImages() | Imagick::labelImage() |
Imagick::clipImage() | Imagick::getImageColorspace() | Imagick::setImageCompose() | Imagick::writeImage() | Imagick::newImage() |
Imagick::clipPathImage() | Imagick::getImageColors() | Imagick::setImageCompression() | Imagick::newPseudoImage() | |
Imagick::coalesceImages() | Imagick::getImageCompose() | Imagick::setImageDelay() | Imagick::nextImage() | |
Imagick::colorFloodFillImage() | Imagick::getImageDelay() | Imagick::setImageDepth() | Imagick::pingImageBlob() | |
Imagick::colorizeImage() | Imagick::getImageDepth() | Imagick::setImageDispose() | Imagick::pingImageFile() | |
Imagick::combineImages() | Imagick::getImageDispose() | Imagick::setImageDispose() | Imagick::pingImage() | |
Imagick::compareImageChannels() | Imagick::getImageDistortion() | Imagick::setImageExtent() | Imagick::previousImage() | |
Imagick::compareImageLayers() | Imagick::getImageExtrema() | Imagick::setImageFilename() | Imagick::profileImage() | |
Imagick::compositeImage() | Imagick::getImageFilename() | Imagick::setImageFormat() | Imagick::queryFormats() | |
Imagick::contrastImage() | Imagick::getImageFormat() | Imagick::setImageGamma() | Imagick::removeImageProfile() | |
Imagick::contrastStretchImage() | Imagick::getImageGamma() | Imagick::setImageGreenPrimary() | Imagick::removeImage() | |
Imagick::convolveImage() | Imagick::getImageGeometry() | Imagick::setImageIndex() | Imagick::setFirstIterator() | |
Imagick::cropImage() | Imagick::getImageGreenPrimary() | Imagick::setImageInterpolateMethod() | Imagick::setImageIndex() | |
Imagick::cycleColormapImage() | Imagick::getImageHeight() | Imagick::setImageIterations() | Imagick::valid() | |
Imagick::deconstructImages() | Imagick::getImageHistogram() | Imagick::setImageMatteColor() | Imagick::getCopyright() | |
Imagick::drawImage() | Imagick::getImageIndex() | Imagick::setImageMatte() | ||
Imagick::edgeImage() | Imagick::getImageInterlaceScheme() | Imagick::setImagePage() | ||
Imagick::embossImage() | Imagick::getImageInterpolateMethod() | Imagick::setImageProfile() | ||
Imagick::enhanceImage() | Imagick::getImageIterations() | Imagick::setImageProperty() | ||
Imagick::equalizeImage() | Imagick::getImageMatteColor() | Imagick::setImageRedPrimary() | ||
Imagick::evaluateImage() | Imagick::getImageMatte() | Imagick::setImageRenderingIntent() | ||
Imagick::flattenImages() | Imagick::getImagePage() | Imagick::setImageResolution() | ||
Imagick::flipImage() | Imagick::getImagePixelColor() | Imagick::setImageScene() | ||
Imagick::flopImage() | Imagick::getImageProfile() | Imagick::setImageTicksPerSecond() | ||
Imagick::getImageProperty() | Imagick::setImageType() | |||
Imagick::fxImage() | Imagick::getImageRedPrimary() | Imagick::setImageUnits() | ||
Imagick::gammaImage() | Imagick::getImageRegion() | Imagick::setImageVirtualPixelMethod() | ||
Imagick::gaussianBlurImage() | Imagick::getImageRenderingIntent() | Imagick::setImageWhitepoint() | ||
Imagick::implodeImage() | Imagick::getImageResolution() | Imagick::setInterlaceScheme() | ||
Imagick::levelImage() | Imagick::getImageScene() | Imagick::setOption() | ||
Imagick::linearStretchImage() | Imagick::getImageSignature() | Imagick::setPage() | ||
Imagick::magnifyImage() | Imagick::getImageTicksPerSecond() | Imagick::setResolution() | ||
Imagick::matteFloodFillImage() | Imagick::getImageTotalInkDensity() | Imagick::setResourceLimit() | ||
Imagick::medianFilterImage() | Imagick::getImageType() | Imagick::setSamplingFactors() | ||
Imagick::minifyImage() | Imagick::getImageUnits() | Imagick::setSizeOffset() | ||
Imagick::modulateImage() | Imagick::getImageVirtualPixelMethod() | Imagick::setSize() | ||
Imagick::montageImage() | Imagick::getImageWhitepoint() | Imagick::setType() | ||
Imagick::morphImages() | Imagick::getImageWidth() | |||
Imagick::mosaicImages() | Imagick::getImage() | |||
Imagick::motionBlurImage() | Imagick::getInterlaceScheme() | |||
Imagick::negateImage() | Imagick::getNumberImages() | |||
Imagick::normalizeImage() | Imagick::getOption() | |||
Imagick::oilPaintImage() | Imagick::getPackageName() | |||
Imagick::optimizeImageLayers() | Imagick::getPage() | |||
Imagick::paintOpaqueImage() | Imagick::getPixelIterator() | |||
Imagick::paintTransparentImage() | Imagick::getPixelRegionIterator() | |||
Imagick::posterizeImage() | Imagick::getQuantumDepth() | |||
Imagick::radialBlurImage() | Imagick::getQuantumRange() | |||
Imagick::raiseImage() | Imagick::getResourceLimit() | |||
Imagick::randomThresholdImage() | Imagick::getResource() | |||
Imagick::reduceNoiseImage() | Imagick::getSamplingFactors() | |||
Imagick::render() | Imagick::getSizeOffset() | |||
Imagick::resampleImage() | Imagick::getSize() | |||
Imagick::resizeImage() | Imagick::identifyImage() | |||
Imagick::rollImage() | Imagick::getImageSize() | |||
Imagick::rotateImage() | ||||
Imagick::sampleImage() | ||||
Imagick::scaleImage() | ||||
Imagick::separateImageChannel() | ||||
Imagick::sepiaToneImage() | ||||
Imagick::shadeImage() | ||||
Imagick::shadowImage() | ||||
Imagick::sharpenImage() | ||||
Imagick::shaveImage() | ||||
Imagick::shearImage() | ||||
Imagick::sigmoidalContrastImage() | ||||
Imagick::sketchImage() | ||||
Imagick::solarizeImage() | ||||
Imagick::spliceImage() | ||||
Imagick::spreadImage() | ||||
Imagick::steganoImage() | ||||
Imagick::stereoImage() | ||||
Imagick::stripImage() | ||||
Imagick::swirlImage() | ||||
Imagick::textureImage() | ||||
Imagick::thresholdImage() | ||||
Imagick::thumbnailImage() | ||||
Imagick::tintImage() | ||||
Imagick::transverseImage() | ||||
Imagick::trimImage() | ||||
Imagick::uniqueImageColors() | ||||
Imagick::unsharpMaskImage() | ||||
Imagick::vignetteImage() | ||||
Imagick::waveImage() | ||||
Imagick::whiteThresholdImage() |
[#1] benkuhl at gmail dot com [2013-01-24 19:52:49]
When using this library with PDFs, the term "image" applies to a page where the pointer begins at the last page of the document.
<?php
$document = new Imagick('myPdf.pdf'); //2 page PDF
$document->getNumberImages(); //returns 2
var_dump($document->hasNextImage()); //returns false - remember, we're on the last page
var_dump($document->hasPreviousImage()); //returns true
?>
If you need to do more than generate thumbnails from a PDF, use XPDF: http://www.foolabs.com/xpdf/home.html
[#2] php at mattjanssen dot com [2010-12-21 12:39:14]
You can find the documentation for all of these magick_wand--the interface Imagic seems to be built on--functions at http://www.graphicsmagick.org/wand/magick_wand.html
[#3] StealthFox at live dot com [2008-10-23 07:15:13]
Users looking to save with these functions should know it can be done easily, for example
<?php
header ("Content-Type: image/{$Imagick->getImageFormat()}");
$data = $Imagick->getImageBlob ();
echo $data;
file_put_contents ('test.png', $data);
?>
That would display the image, and then save it to test.png. Such things are helpful especially when you need to reload images after creating them or save for later. :)