使用合成程序將一個圖像重疊在另一個圖像上。
有關如何構造合成命令的建議,請參閱命令行處理,或參見下列的命令範例用法。
/usr/local/ImageMagick/bin/magick composite -help
在此列出一些合成命令的範例,以說明其有用性和易用性。
首先,讓我們在玫瑰上疊加一個笑臉:
/usr/local/ImageMagick/bin/magick composite -gravity center smile.gif rose.jpg rose-over.png
或者,可以使用 Atop 創建三維效果:
/usr/local/ImageMagick/bin/magick convert -size 70x70 canvas:none -fill red -draw 'circle 35,35 10,30' red-circle.png
/usr/local/ImageMagick/bin/magick convert -size 70x70 canvas:none -draw 'circle 35,35 35,20' -negate -channel A -gaussian-blur 0x8 white-highlight.png
/usr/local/ImageMagick/bin/magick composite -compose Atop -geometry +0+0 white-highlight.png red-circle.png red-ball.png
可以在 Examples of ImageMagick Usage 的範例中找到使用合成的其他範例。
可以通過查看 SVG Alpha Compositing 了解更多關於它們和數學的信息
| -affine matrix | affine transform matrix |
|---|---|
| -alpha | on, activate, off, deactivate, set, opaque, copy, transparent, extract, background, or shape the alpha channel |
| -authenticate value | decrypt image with this password |
| -blend geometry | blend images |
| -blue-primary point | chromaticity blue primary point |
| -border geometry | surround image with a border of color |
| -bordercolor color | border color |
| -channel type | apply option to select image channels |
| -colors value | preferred number of colors in the image |
| -colorspace type | set image colorspace |
| -comment string | annotate image with comment |
| -compose operator | set image composite operator |
| -compress type | image compression type |
| -debug events | display copious debugging information |
| -decipher filename | convert cipher pixels to plain |
| -define format:option | define one or more image format options |
| -density geometry | horizontal and vertical density of the image |
| -depth value | image depth |
| -displace geometry | shift image pixels defined by a displacement map |
| -dissolve value | dissolve the two images a given percent |
| -dither method | apply error diffusion to image |
| -encipher filename | convert plain pixels to cipher pixels |
| -encoding type | text encoding type |
| -endian type | endianness (MSB or LSB) of the image |
| -extract geometry | extract area from image |
| -filter type | use this filter when resizing an image |
| -font name | render text with this font |
| -geometry geometry | preferred size or location of the image |
| -gravity type | horizontal and vertical text placement |
| -green-primary point | chromaticity green primary point |
| -help | print program options |
| -identify | identify the format and characteristics of the image |
| -interlace type | type of image interlacing scheme |
| -interpolate method | pixel color interpolation method |
| -label string | assign a label to an image |
| -level value | adjust the level of image contrast |
| -limit type value | pixel cache resource limit |
| -log format | format of debugging information |
| -monitor | monitor progress |
| -monochrome | transform image to black and white |
| -negate | replace each pixel with its complementary color |
| -page geometry | size and location of an image canvas (setting) |
| -pointsize value | font point size |
| -profile filename | add, delete, or apply an image profile |
| -quality value | JPEG/MIFF/PNG compression level |
| -quantize colorspace | reduce image colors in this colorspace |
| -quiet | suppress all warning messages |
| -red-primary point | chromaticity red primary point |
| -regard-warnings | pay attention to warning messages. |
| -respect-parentheses | settings remain in effect until parenthesis boundary. |
| -rotate degrees | apply Paeth rotation to the image |
| -sampling-factor geometry | horizontal and vertical sampling factor |
| -scene value | image scene number |
| -seed value | seed a new sequence of pseudo-random numbers |
| -set attribute value | set an image attribute |
| -sharpen geometry | sharpen the image |
| -shave geometry | shave pixels from the image edges |
| -size geometry | width and height of image |
| -stegano offset | hide watermark within an image |
| -stereo geometry | combine two image to create a stereo anaglyph |
| -strip | strip image of all profiles and comments |
| -swap indexes | swap two images in the image sequence |
| -synchronize | synchronize image to storage device |
| -taint | mark the image as modified |
| -thumbnail geometry | create a thumbnail of the image |
| -tile | repeat composite operation across and down image |
| -transform | affine transform image |
| -transparent-color color | transparent color |
| -treedepth value | color tree depth |
| -type type | image type |
| -units type | the units of image resolution |
| -unsharp geometry | sharpen the image |
| -verbose | print detailed information about the image |
| -version | print version information |
| -virtual-pixel method | access method for pixels outside the boundaries of the image |
| -watermark geometry | percent brightness and saturation of a watermark |
| -white-point point | chromaticity white point |
| -white-threshold value | force all pixels above the threshold into white |
| -write filename | write images to this file |
參考資料:
Command-line Tools: Composite @ ImageMagick
http://www.imagemagick.org/script/composite.php
| 新增時間 | 2020-02-05 |
| 最後更新 | 2022-02-09 |