⚠️ 这是一个非官方翻译网站,与 ImageMagick Studio LLC 无关。准确信息请参阅原文(https://imagemagick.org/conjure/)

conjure(MSL 脚本)

使用示例 • 选项一览 • Magick Scripting Language (MSL)

conjure 程序让你能够从用 Magick Scripting Language(MSL)编写的脚本执行自定义图像处理任务。MSL 基于 XML,由带属性的动作语句构成。动作包括读取图像、处理图像、获取图像属性、写出图像等。属性是修改动作行为的 key/value 对。有关如何组织 conjure 命令的建议,请参阅命令行处理,或参阅下面的命令使用示例。

使用示例

为说明 conjure 命令的实用性和易用性,这里列举几个示例。首先,给出一个简单的 conjure 命令:

magick conjure -dimensions 400x400 msl:incantation.msl

上面使用的 MSL 脚本 incantation.msl 如下:

<?xml version="1.0" encoding="UTF-8"?>
<image>
  <read filename="image.gif" />
  <get width="base-width" height="base-height" />
  <resize geometry="%[dimensions]" />
  <get width="resize-width" height="resize-height" />
  <print output="Image sized from %[base-width]x%[base-height] to %[resize-width]x%[resize-height].\n" />
  <write filename="image.png" />
</image>

在这个示例中,一个家庭在假期里待在家中,但在朋友看来他们去了加勒比海的美丽海滩:

<?xml version="1.0" encoding="UTF-8"?>
<group>
    <image id="family">
        <read filename="family.gif"/>
        <resize geometry="300x300"/>
    </image>
    <image id="palm-trees">
        <read filename="palm-trees.gif"/>
        <resize geometry="300x100"/>
    </image>
    <image>
        <read filename="beach.jpg"/>
        <composite image="family" geometry="+30+40"/>
        <composite image="palm-trees" geometry="+320+90"/>
    </image>
    <write filename="family-vacation.png"/>
</group>

这里以像素为单位显示特定字体和点大小的文本宽度。

<?xml version="1.0" encoding="UTF-8"?>
<image>
  <query-font-metrics text="ImageMagick" font="helvetica" pointsize="48" />
  <print output="Text width is %[msl:font-metrics.width] pixels.\n" />
</image>

query-font-metrics 标签支持以下属性:

msl:font-metrics.pixels_per_em.x
msl:font-metrics.pixels_per_em.y
msl:font-metrics.ascent
msl:font-metrics.descent
msl:font-metrics.width
msl:font-metrics.height
msl:font-metrics.max_advance
msl:font-metrics.bounds.x1
msl:font-metrics.bounds.y1
msl:font-metrics.bounds.x2
msl:font-metrics.bounds.y2
msl:font-metrics.origin.x
msl:font-metrics.origin.y

MSL 支持 ImageMagick 的 Perl API 中讨论的大多数方法和属性。

此外,MSL 支持带单个 indexes 元素的 swap 元素。

选项一览

conjure 命令识别以下选项。点击某个选项可查看其工作方式的详细信息。

Option Description
-debug events 显示大量调试信息
-help 打印程序选项
-log format 调试信息的格式
-monitor 监视进度
-quiet 抑制所有警告消息
-regard-warnings 重视警告消息
-seed value 为新的伪随机数序列设置种子
-verbose 打印图像的详细信息
-version 打印版本信息

Magick Scripting Language

conjure 命令识别以下 MSL 元素。带删除线的元素尚未受支持。

Magick Scripting Language (MSL) 方法 参数 说明
~~adaptiveblur~~ geometry="geometry", radius="double", sigma="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用指定 radius 和标准差(sigma)的高斯算子自适应地模糊图像。在边缘附近减弱效果。
~~adaptiveresize~~ geometry="geometry", width="integer", height="integer", filter="Point, Box, Triangle, Hermite, Hanning, Hamming, Blackman, Gaussian, Quadratic, Cubic, Catrom, Mitchell, Lanczos, Bessel, Sinc", support="double", blur="double" 使用数据相关的三角剖分自适应地调整图像尺寸。模糊指定 blur > 1,锐化指定 < 1。
~~adaptivesharpen~~ geometry="geometry", radius="double", sigma="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用指定 radius 和标准差(sigma)的高斯算子自适应地锐化图像。在边缘附近增强效果。
~~adaptivethreshold~~ geometry="geometry", width="integer", height="integer", offset="integer" 局部自适应阈值处理。
~~addnoise~~ noise="Uniform, Gaussian, Multiplicative, Impulse, Laplacian, Poisson", attenuate="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 向图像添加噪声
~~affinetransform~~ affine="array of float values", translate="float, float", scale= "float, float", rotate="float", skewX="float", skewY="float", interpolate="Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor", background="color name" 对图像进行仿射变换
~~affinity~~ image="image-handle", method="None, FloydSteinberg, Riemersma" 从该图像中选择一组特定的颜色
text="string", font="string", family="string", style="Normal, Italic, Oblique, Any", stretch="Normal, UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded", weight="integer", pointsize="integer", density="geometry", stroke="color name", strokewidth="integer", fill="color name", undercolor="color name", kerning="float", geometry="geometry", gravity="NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast", antialias="true, false", x="integer", y="integer", affine="array of float values", translate="float, float", scale="float, float", rotate="float". skewX="float", skewY= "float", align="Left, Center, Right", encoding="UTF-8", interline-spacing="double", interword-spacing="double", direction="right-to-left, left-to-right" 用文本为图像添加注释。如需不渲染任何文本即获取字体度量,请参阅 QueryFontMetrics。
~~autogamma~~ channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 自动调整图像的伽马级别
~~autolevel~~ channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 自动调整图像的色阶
autoorient 调整图像使其方向适合查看(即左上方向)
~~blackthreshold~~ threshold="string", , channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 强制将低于阈值强度的所有像素变为黑色
~~blueshift~~ factor="double", 模拟月光下的夜间场景。从 factor 1.5 开始。
geometry="geometry", radius="double", sigma="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用指定 radius 和标准差(sigma)的高斯算子减少图像噪声和细节级别。
geometry="geometry", width="integer", height="integer", bordercolor="color name", compose="Undefined, Add, Atop, Blend, Bumpmap, Clear, ColorBurn, ColorDodge, Colorize, CopyBlack, CopyBlue, CopyCMYK, Cyan, CopyGreen, Copy, CopyMagenta, CopyOpacity, CopyRed, RGB, CopyYellow, Darken, Dst, Difference, Displace, Dissolve, DstAtop, DstIn, DstOut, DstOver, Dst, Exclusion, HardLight, Hue, In, Lighten, Luminize, Minus, Modulate, Multiply, None, Out, Overlay, Over, Plus, ReplaceCompositeOp, Saturate, Screen, SoftLight, Src, SrcAtop, SrcIn, SrcOut, SrcOver, Src, Subtract, Threshold, Xor ", 用彩色边框环绕图像
geometry="geometry", radius="double", sigma="double" 模拟木炭画
geometry="geometry", width="integer", height="integer", x="integer", y="integer" 切除图像的一部分(chop)
~~clamp~~ channel="Red, RGB, All, etc." 将值低于零的每个像素设为零,将值高于量子范围的像素设为量子范围(例如 65535),否则像素值保持不变。
~~clip~~ id="name", inside=""true, false"", 沿 8BIM 配置文件中的命名路径应用。
~~clipmask~~ mask="image-handle" 按图像蒙版的定义裁剪图像
~~clut~~ image="image-handle", interpolate="Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor", channel="Red, RGB, All, etc." 对图像序列应用颜色查找表
~~coalesce~~ 合并图像序列
~~color~~ color="color name" 将整幅图像设为此颜色。
~~colordecisionlist~~ filename="string", 用颜色决策列表进行色彩校正。
fill="color name", blend="string" 用填充色为图像着色
~~colormatrix~~ matrix="array of float values" 对图像应用色彩校正。虽然可以使用可变尺寸的矩阵,但通常对 RGBA 图像使用 5x5,对 CMYKA 使用 6x6。偏移需要 6x6 矩阵(在最后一列填入归一化值)。
string 为图像添加注释
~~comparelayers~~ method="any, clear, overlay" 将序列中的每幅图像与下一幅比较,返回它发现的任何像素差异的最小外接区域。图像不必尺寸相同,但最好所有图像都已 coalesce(所有图像尺寸相同、位于扁平化画布上,从而精确表示某一帧应有的外观)。
image="image-handle", compose="Undefined, Add, Atop, Blend, Bumpmap, Clear, ColorBurn, ColorDodge, Colorize, CopyBlack, CopyBlue, CopyCMYK, Cyan, CopyGreen, Copy, CopyMagenta, CopyOpacity, CopyRed, RGB, CopyYellow, Darken, Dst, Difference, Displace, Dissolve, DstAtop, DstIn, DstOut, DstOver, Dst, Exclusion, HardLight, Hue, In, Lighten, Luminize, Minus, Modulate, Multiply, None, Out, Overlay, Over, Plus, ReplaceCompositeOp, Saturate, Screen, SoftLight, Src, SrcAtop, SrcIn, SrcOut, SrcOver, Src, Subtract, Threshold, Xor ", mask="image-handle", geometry="geometry", x="integer", y="integer", gravity="NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast", opacity="integer", tile="True, False", rotate="double", color="color name", blend="geometry", interpolate="undefined, average, bicubic, bilinear, filter, integer, mesh, nearest-neighbor, spline" 将一幅图像合成到另一幅图像上。rotate 参数与 tile 参数配合使用。
sharpen="True, False" 增强或减弱图像对比度
~~contraststretch~~ levels="string", 'black-point'="double", 'white-point'="double", channel="Red, RGB, All, etc." 通过“拉伸”强度值范围来改善图像的对比度
~~convolve~~ coefficients="array of float values", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", bias="double" 对图像应用卷积核。给定核的“阶(order)”,需提供 order*order 个浮点值(例如 3x3 表示 9 个值)。
geometry="geometry", width="integer", height="integer", x="integer", y="integer", fuzz="double", gravity="NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast" 裁剪图像
~~cyclecolormap~~ amount="integer" 将图像的色彩映射表位移 amount
~~decipher~~ passphrase="string" 将加密像素转换为明文像素
~~deconstruct~~ 将图像序列分解为各个组成部分
~~deskew~~ geometry="string",threshold="double" 校正图像的倾斜
减少图像内的斑点噪声
~~difference~~ image="image-handle" 计算两幅图像之间的差异指标
~~distort~~ points="array of float values", method="Affine, AffineProjection, Bilinear, Perspective, Resize, ScaleRotateTranslate", virtual-pixel="Background Black Constant Dither Edge Gray Mirror Random Tile Transparent White", best-fit="True, False" 扭曲图像
primitive="point, line, rectangle, arc, ellipse, circle, path, polyline, polygon, bezier, color, matte, text, @"filename"", points="string" , method=""Point, Replace, Floodfill, FillToBorder, Reset"", stroke="color name", fill="color name", font="string", pointsize="integer", strokewidth="float", antialias="true, false", bordercolor="color name", x="float", y="float", dash-offset="float", dash-pattern="array of float values", affine="array of float values", translate="float, float", scale="float, float", rotate="float", skewX="float", skewY="float", interpolate="undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline", kerning="float", text="string", vector-graphics="string", interline-spacing="double", interword-spacing="double", direction="right-to-left, left-to-right" 用一个或多个图形基元为图像添加注释。
~~encipher~~ passphrase="string" 将明文像素转换为加密像素
radius="double" 用指定 radius 的卷积滤波器增强图像内的边缘。
geometry="geometry", radius="double", sigma="double" 用指定 radius 和标准差(sigma)的卷积滤波器对图像进行浮雕处理。
应用数字滤波器以改善噪声较多的图像
channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 对图像执行直方图均衡化
~~extent~~ geometry="geometry", width="integer", height="integer", x="integer", y="integer", fuzz="double", background="color name", gravity="NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast" 设置图像尺寸
~~evaluate~~ value="double", operator=""Add, And, Divide, LeftShift, Max, Min, Multiply, Or, Rightshift, Subtract, Xor"", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 对图像应用算术、关系或逻辑表达式
~~filter~~ kernel="string", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", bias="double" 对图像应用卷积核。
沿垂直方向反射图像扫描线
沿水平方向反射图像扫描线
~~floodfillpaint~~ geometry="geometry", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", x="integer", y="integer" , fill="color name", bordercolor="color name", fuzz="double", invert="True, False" 更改与目标像素颜色匹配且相邻的任意像素的颜色值。若指定边框色,则更改任意非该颜色的相邻像素的颜色值。
~~forwardfouriertransform~~ magnitude="True, False" 实现正向离散傅里叶变换(DFT)
geometry="geometry", width="integer", height="integer", inner="integer", outer="integer", fill="color name", compose="Undefined, Add, Atop, Blend, Bumpmap, Clear, ColorBurn, ColorDodge, Colorize, CopyBlack, CopyBlue, CopyCMYK, Cyan, CopyGreen, Copy, CopyMagenta, CopyOpacity, CopyRed, RGB, CopyYellow, Darken, Dst, Difference, Displace, Dissolve, DstAtop, DstIn, DstOut, DstOver, Dst, Exclusion, HardLight, Hue, In, Lighten, Luminize, Minus, Modulate, Multiply, None, Out, Overlay, Over, Plus, ReplaceCompositeOp, Saturate, Screen, SoftLight, Src, SrcAtop, SrcIn, SrcOut, SrcOver, Src, Subtract, Threshold, Xor ", 用装饰性边框环绕图像
~~function~~ parameters="array of float values", function="Sin", virtual-pixel="Background Black Constant Dither Edge Gray Mirror Random Tile Transparent White" 对图像应用函数
gamma="string", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 对图像进行伽马校正
~~gaussianblur~~ geometry="geometry", radius="double", sigma="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用指定 radius 和标准差(sigma)的高斯算子减少图像噪声和细节级别。
~~getpixel~~ geometry="geometry", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", normalize="true, false", x="integer", y="integer" 获取单个像素。默认返回归一化的像素值。
~~getpixels~~ geometry="geometry", width="integer", height="integer", x="integer", y="integer", map="string", normalize="true, false" 获取由 map(例如 "RGB"、"RGBA" 等)定义的图像像素。默认返回非归一化的像素值。
~~grayscale~~ channel="Average, Brightness, Lightness, Rec601Luma, Rec601Luminance, Rec709Luma, Rec709Luminance, RMS" 将图像转换为灰度
~~haldclut~~ image="image-handle", channel="Red, RGB, All, etc." 对图像序列应用 Hald 颜色查找表
~~identify~~ file="file", features="distance", unique="True, False" 识别图像的属性
amount="double", interpolate="undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline" 使图像像素向中心内爆
~~inversediscretefouriertransform~~ magnitude="True, False" 实现逆离散傅里叶变换(DFT)
string 为图像分配标签
~~layers~~ method="coalesce, compare-any, compare-clear, compare-over, composite, dispose, flatten, merge, mosaic, optimize, optimize-image, optimize-plus, optimize-trans, remove-dups, remove-zero", compose="Undefined, Add, Atop, Blend, Bumpmap, Clear, ColorBurn, ColorDodge, Colorize, CopyBlack, CopyBlue, CopyCMYK, Cyan, CopyGreen, Copy, CopyMagenta, CopyOpacity, CopyRed, RGB, CopyYellow, Darken, Dst, Difference, Displace, Dissolve, DstAtop, DstIn, DstOut, DstOver, Dst, Exclusion, HardLight, Hue, In, Lighten, LinearLight, Luminize, Minus, Modulate, Multiply, None, Out, Overlay, Over, Plus, ReplaceCompositeOp, Saturate, Screen, SoftLight, Src, SrcAtop, SrcIn, SrcOut, SrcOver, Src, Subtract, Threshold, Xor ", dither="true, false" 将每幅图像与序列中前一幅图像的 GIF 处置形态比较。由此,在保留动画结果的同时,尝试选择最小的裁剪图像来替换每一帧。
levels="string", 'black-point'="double", 'gamma'="double", 'white-point'="double", channel="Red, RGB, All, etc." 调整图像的对比度级别
~~levelcolors~~ invert=>"True, False", 'black-point'="string", 'white-point'="string", channel="Red, RGB, All, etc." 用给定的颜色对图像进行色阶调整
~~linearstretch~~ levels="string", 'black-point'="double", 'white-point'="double" 带饱和的线性拉伸
~~liquidresize~~ geometry="geometry", width="integer", height="integer", delta-x="double", rigidity="double" 用接缝裁剪(seam-carving)重新缩放图像。
用像素艺术缩放将图像放大一倍
~~mask~~ mask="image-handle" 按蒙版的定义合成图像像素
~~mattefloodfill~~ geometry="geometry", x="integer", y="integer" , matte="integer", bordercolor="color name", fuzz="double", invert="True, False" 更改与目标像素颜色匹配且相邻的任意像素的蒙版(matte)值。若指定边框色,则更改任意非该颜色的相邻像素的蒙版值。
~~medianfilter~~ geometry="geometry", width="integer", height="integer", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用邻域的中值强度像素替换每个像素。
将图像尺寸缩小一半
~~mode~~ geometry="geometry", width="integer", height="integer", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 将每个像素设为邻域的“主色”。
factor="geometry", brightness="double", saturation="double", hue="double", lightness="double", whiteness="double", blackness="double" 按指定百分比改变图像的亮度、饱和度和色相
~~morphology~~ kernel="string", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", iterations="integer" 对图像应用形态学方法。
~~motionblur~~ geometry="geometry", radius="double", sigma="double", angle="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用指定 radius、标准差(sigma)和角度的高斯算子减少图像噪声和细节级别,以模拟运动效果
gray="True, False", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用每个像素的补色替换该像素(白变黑、黄变蓝,等等)
channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 变换图像以覆盖色值的整个范围
~~oilpaint~~ radius="integer" 模拟油画
color="color name", fill="color name", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", invert="True, False" 将图像内的此颜色更改为填充色
~~ordereddither~~ threshold="threshold, checks, o2x2, o3x3, o4x4, o8x8, h4x4a, h6x6a, h8x8a, h4x4o, h6x6o, h8x8o, h16x16o, hlines6x4", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 对图像进行有序抖动
~~perceptible~~ epsilon="double", channel="Red, RGB, All, etc." 将值小于
~~polaroid~~ caption="string", angle="double", pointsize="double", font="string", stroke= "color name", strokewidth="integer", fill="color name", gravity="NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast", background="color name" 模拟宝丽来照片。
~~posterize~~ levels="integer", dither="True, False" 将图像减少到有限数量的色阶
name="string", profile="blob", rendering-intent="Undefined, Saturation, Perceptual, Absolute, Relative", black-point-compensation="True, False" 添加或删除 ICC 或 IPTC 图像配置文件;name 为正式名称(例如 ICC)或文件名;将 profile 设为 '' 以删除配置文件
colors="integer", colorspace="RGB, Gray, Transparent, OHTA, XYZ, YCbCr, YIQ, YPbPr, YUV, CMYK, sRGB, HSL, HSB", treedepth= "integer", dither="True, False", dither-method="Riemersma, Floyd-Steinberg", measure_error="True, False", global_colormap="True, False", transparent-color="color" 图像中首选的颜色数量
~~radialblur~~ geometry="geometry", angle="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 对图像进行放射状模糊。
geometry="geometry", width="integer", height="integer", x="integer", y="integer", raise="True, False" 提亮或压暗图像边缘以营造 3D 效果
~~reducenoise~~ geometry="geometry", width="integer", height="integer", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用噪声峰值消除滤波器减少图像中的噪声
~~remap~~ image="image-handle", dither="true, false", dither-method="Riemersma, Floyd-Steinberg" 用参考图像中最接近的颜色替换图像的颜色。
density="geometry", x="double", y="double", filter="Point, Box, Triangle, Hermite, Hanning, Hamming, Blackman, Gaussian, Quadratic, Cubic, Catrom, Mitchell, Lanczos, Bessel, Sinc", support="double" 将图像重采样到所需分辨率。模糊指定 blur > 1,锐化指定 < 1。
geometry="geometry", width="integer", height="integer", filter="Point, Box, Triangle, Hermite, Hanning, Hamming, Blackman, Gaussian, Quadratic, Cubic, Catrom, Mitchell, Lanczos, Bessel, Sinc", support="double", blur="double" 将图像缩放到所需尺寸。模糊指定 blur > 1,锐化指定 < 1。
geometry="geometry", x="integer", y="integer" 垂直或水平地滚动图像
degrees="double", background="color name" 旋转图像
geometry="geometry", width="integer", height="integer" 用像素采样缩放图像。
geometry="geometry", width="integer", height="integer" 将图像缩放到所需尺寸
colorspace="RGB, Gray, Transparent, OHTA, XYZ, YCbCr, YCC, YIQ, YPbPr, YUV, CMYK", verbose="True, False", cluster-threshold="double", smoothing-threshold="double" 通过分析各颜色分量的直方图并识别均质单元来对图像进行分割
~~selectiveblur~~ geometry="geometry", radius="double", sigma="double", threshold="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 选择性地模糊对比度阈值内的像素。
~~separate~~ channel="Red, RGB, All, etc." 从图像中分离出一个通道为灰度图像
geometry="geometry", azimuth="double", elevation="double", gray="true, false" 用远距离光源为图像添加阴影
~~setpixel~~ geometry="geometry", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", color="array of float values", x="integer", y="integer", color="array of float values" 设置单个像素。默认期望归一化的像素值。
geometry="geometry", opacity="double", sigma="double", x="integer", y="integer" 模拟图像阴影
geometry="geometry", radius="double", sigma="double", bias="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 用指定 radius 和标准差(sigma)的高斯算子锐化图像。
geometry="geometry", width="integer", height="integer" 从图像边缘削去像素
geometry="geometry", x="double", y="double" fill="color name" 用正或负的剪切角沿 X 轴或 Y 轴剪切图像
~~sigmoidalcontrast~~ geometry="string", 'contrast'="double", 'mid-point'="double" channel="Red, RGB, All, etc.", sharpen="True, False" S 形非线性对比度控制。使用 S 形传递函数,在不使高光或阴影饱和的情况下提高图像对比度。Contrast 表示提高多少对比度(0 为无,3 为典型,20 为很大);mid-point 表示中间调在结果图像中的位置(0 为白,50% 为中灰,100% 为黑)。要降低对比度,请将 sharpen 设为 False。
为图像像素流生成 SHA-256 消息摘要
~~sketch~~ geometry="geometry", radius="double", sigma="double", angle="double" 用指定 radius、标准差(sigma)和角度的高斯算子对图像进行素描处理
geometry="string", threshold="double", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 反转高于阈值级别的所有像素
~~sparsecolor~~ points="array of float values", method="Barycentric, Bilinear, Shepards, Voronoi", virtual-pixel="Background Black Constant Dither Edge Gray Mirror Random Tile Transparent White" 在所提供点的周围对图像颜色进行插值
~~splice~~ geometry="geometry", width="integer", height="integer", x="integer", y="integer", fuzz="double", background="color name", gravity="NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast" 在图像中拼入(splice)
radius="double", interpolate="undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline" 将图像像素随机位移一定量
~~statistic~~ geometry="geometry", width="integer", height="integer", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow", type="Median, Mode, Mean, Maximum, Minimum, ReduceNoise" 用邻域的相应统计值替换每个像素。
image="image-handle", offset="integer" 在图像内隐藏数字水印
image="image-handle", x="integer", y="integer" 合成两幅图像并生成一幅由立体像对的左右图像合成而成的单一图像
从图像中剥除所有配置文件和注释。
degrees="double", interpolate="undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline" 围绕中心使图像像素旋涡
~~texture~~ texture="image-handle" 在图像背景上平铺的纹理名称
~~thumbnail~~ geometry="geometry", width="integer", height="integer" 将图像尺寸更改为给定尺寸并移除任何相关的配置文件。
threshold="string", channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 对图像进行阈值处理
~~tint~~ fill="color name", blend="string" 用填充色为图像染色。
color="color name", invert="True, False" 使图像内的此颜色透明
~~transpose~~ 垂直翻转图像并旋转 90 度
~~transverse~~ 水平翻转图像并旋转 270 度
从图像中移除背景色的边缘
~~unsharpmask~~ geometry="geometry", radius="double", sigma="double", gain="double", threshold="double" 用钝化蒙版(unsharp mask)算法锐化图像。
~~vignette~~ geometry="geometry", radius="double", sigma="double", x="integer", y="integer", background="color name" 以晕影风格偏移图像边缘
~~wave~~ geometry="geometry", amplitude="double", wavelength="double", interpolate="undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline" 沿正弦波改变图像
~~whitethreshold~~ threshold="string", , channel="All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow" 强制将高于阈值强度的所有像素变为白色