ImageMagick 示例 --
背景示例

ImageMagick 示例前言和索引
此表展示了将各种变换应用于一些“随机”画布,展示了在您想要的任何尺寸生成有趣随机背景的方法,无论是单个大图像还是网页的背景图块。 该表从用于生成所有其他显示图像的初始“随机”图像的方法开始。 只需将各种图像“变换”插入命令中,即可将原始图像变换为类似于显示的图像。 从那里,您可以自己调整各种设置,以生成您想要的背景图像类型。 请务必在尝试创建自己的示例之前阅读最后的说明,并将您遇到的任何有趣的变体发送给我。
输入图像:- 生成器、变换和后处理  
此处显示的图像结果使用“-noop”空变换运算符生成
等离子体分形(非平铺画布图像)

  magick -size 120x120  plasma:fractal fractal.png
  magick fractal.png   {..transform..} \
           -shave 20x20 +repage  -auto_level  {result}
 
[IM Output]
随机噪声(可平铺的背景图像)

  magick -size 80x80 xc: +noise Random noise.png
  magick noise.png -virtual-pixel tile  {..transform..} \
          -auto_level  {result}
 
[IM Output]
随机六边形图块(六边形图块背景图像)

  magick -size 50x80 xc: +noise Random -write mpr:rand \
           -extent 100x80   -page +50-40 mpr:rand \
           -page +50+40 mpr:rand -flatten  hextile.png
  magick hextile.png -virtual-pixel tile  {..transform..} \
          -auto_level    {result}
 
[IM Output]
 
基本变换
blur_raw (无后处理 -auto-level)
  -blur 0x1
[Fractal] [Noise] [Noise]
blur_1
  -blur 0x1
[Fractal] [Noise] [Noise]
blur_3
  -blur 0x3
[Fractal] [Noise] [Noise]
blur_5
  -blur 0x5
[Fractal] [Noise] [Noise]
blur_10
  -blur 0x10
[Fractal] [Noise] [Noise]
intensity
  -blur 0x10  -colorspace Gray
[Fractal] [Noise] [Noise]
channel
  -blur 0x10  -fx G
[Fractal] [Noise] [Noise]
hues
  -blur 0x10 -auto-level -separate -background white \
     -compose ModulusAdd -flatten -channel R -combine +channel \
     -set colorspace HSB -colorspace RGB
[Fractal] [Noise] [Noise]
阴影变换
shade_raw (无后处理 -auto-level)
  -shade 120x45
[Fractal] [Noise] [Noise]
shade
  -shade 120x45
[Fractal] [Noise] [Noise]
shade_dimmed (无后处理 -auto-level)
  -shade 120x45 -auto-level -fill grey -colorize 40%
[Fractal] [Noise] [Noise]
shade_1
  -blur 0x1 -shade 120x45
[Fractal] [Noise] [Noise]
shade_2
  -blur 0x2 -shade 120x45
[Fractal] [Noise] [Noise]
shade_5
  -blur 0x5 -shade 120x45
[Fractal] [Noise] [Noise]
shade_10
  -blur 0x10 -fx G -shade 120x45
[Fractal] [Noise] [Noise]
浮雕变换
emboss_1
  -blur 0x5  -emboss 1
[Fractal] [Noise] [Noise]
emboss_1g
  -blur 0x5  -emboss 1  -fx G
[Fractal] [Noise] [Noise]
emboss_0s
  -blur 0x3  -emboss .5 -shade 120x45
[Fractal] [Noise] [Noise]
emboss_1s
  -blur 0x5  -emboss 1  -shade 120x45
[Fractal] [Noise] [Noise]
emboss_1gs
  -blur 0x5  -emboss 1  -fx G  -shade 120x45
[Fractal] [Noise] [Noise]
emboss_5gs
  -blur 0x10 -emboss 5  -fx G  -shade 120x45
[Fractal] [Noise] [Noise]
边缘变换
charcoal
  -blur 0x2  -charcoal 10 -negate
[Fractal] [Noise] [Noise]
charcoal_10s
  -blur 0x2  -charcoal 10 -negate -shade 120x45
[Fractal] [Noise] [Noise]
charcoal_1s
  -blur 0x2  -charcoal 1  -negate -shade 120x45
[Fractal] [Noise] [Noise]
edges
  -blur 0x2  -edge 10
[Fractal] [Noise] [Noise]
edge_grey
  -blur 0x2  -edge 10 -fx G
[Fractal] [Noise] [Noise]
mesas
  -blur 0x2  -edge 10 -fx G -shade 120x45
[Fractal] [Noise] [Noise]
线条生成变换
lines
  -blur 0x10 -emboss 4 -edge 1
[Fractal] [Noise] [Noise]
loops
  -blur 0x10 -edge 15  -edge 1  -blur 0x1
[Fractal] [Noise] [Noise]
engrave_loops
  -blur 0x10 -edge 15  -edge 1  -blur 0x1 -fx R+B+G -shade 280x45
[Fractal] [Noise] [Noise]
engrave_loop
  -blur 0x10 -edge 15  -edge 1  -blur 0x1 -fx G -shade 280x45
[Fractal] [Noise] [Noise]
color_contours
  -blur 0x10 -normalize -fx 'sin(u*4*pi)*100' -edge 1 -blur 0x1
[Fractal] [Noise] [Noise]
contours
  -blur 0x10 -normalize -fx 'sin(g*4*pi)*100' \
     -edge 1 -blur 0x1 -shade 280x45
[Fractal] [Noise] [Noise]
复杂纹理斑点变换
(使用奇怪的“-edge 1”效果)
blobs
  -blur 0x10 -edge 1
[Fractal] [Noise] [Noise]
blobs_grey
  -blur 0x10 -edge 1 -fx '(R+G+B)/3'
[Fractal] [Noise] [Noise]
pits
  -blur 0x10 -edge 1 -fx G -shade 280x45
[Fractal] [Noise] [Noise]
ridges
  -blur 0x10 \( +clone -negate \) -edge 1 -fx u.G+v.G -shade 280x45
[Fractal] [Noise] [Noise]
mottled
  -blur 0x10 -write mpr:save -negate -edge 1 -negate -fx G \
     \( mpr:save -edge 1 -fx G \) -shade 280x45 -evaluate-sequence mean
[Fractal] [Noise] [Noise]
绘制变换
paint_raw10 (无后处理 -auto-level)
  -paint 10
[Fractal] [Noise] [Noise]
paint_areas
  -paint 10  -blur 0x5  -paint 10
[Fractal] [Noise] [Noise]
paint_raw10s
  -paint 10  -shade 120x45
[Fractal] [Noise] [Noise]
paint_8
  -blur 0x5  -paint 8
[Fractal] [Noise] [Noise]
paint_8s
  -blur 0x5  -paint 8  -shade 120x45
[Fractal] [Noise] [Noise]
paint_3
  -blur 0x10 -paint 3
[Fractal] [Noise] [Noise]
paint_3s
  -blur 0x10 -paint 3  -shade 120x45
[Fractal] [Noise] [Noise]
paint_3d
  -blur 0x10 -paint 3 \( +clone -shade 120x45 \) \
     +swap  -compose overlay -composite
[Fractal] [Noise] [Noise]
渐变变换
levels (无后处理 -auto-level)
  -blur 0x12 -fx intensity -normalize \
     -size 1x9 gradient:navy-lavender \
     -interpolate integer -fx 'v.p{0,G*(v.h-1)}'
[Fractal] [Noise] [Noise]
levels_3d (无后处理 -auto-level)
  -blur 0x12 -fx intensity -normalize \
     -size 1x9 gradient:navy-lavender \
     -interpolate integer -fx 'v.p{0,G*(v.h-1)}' \
     \( +clone -shade 120x45 -normalize \) \
     -compose overlay -composite
[Fractal] [Noise] [Noise]
zebra
  -blur 0x12 -normalize \
     -size 1x19   pattern:gray50   -fx 'v.p{0,G*(v.h-1)}'
[Fractal] [Noise] [Noise]
midlevel
  -blur 0x12 -normalize \
     \( -size 1x9 xc: -draw 'color 0,4 point' -negate \) \
     -fx 'v.p{0,G*(v.h-1)}'
[Fractal] [Noise] [Noise]
edged_level (无后处理 -auto-level)
  -blur 0x12 -normalize \
     \( -size 1x9 xc: -draw 'color 0,4 point' \) \
     -fx '(.6+.2*v.p{0,G*(v.h-1)})' \
     \( +clone -normalize -edge 1 \)  -fx 'u+v'
[Fractal] [Noise] [Noise]
layered_levels (无后处理 -auto-level)
  -blur 0x12 -normalize \
     \( -size 1x9 xc: -draw 'color 0,4 point' \) \
     -fx '(.5+.3*v.p{0,u*(v.h-1)})' \
     \( +clone -normalize -edge .3 -fx 'R+G+B' \) \
     -fx 'intensity+v'  -fill skyblue -tint 100
[Fractal] [Noise] [Noise]
其他
filaments
  -blur 0x5 -normalize -fx g \
     -sigmoidal-contrast 15x50% -solarize 50%
[Fractal] [Noise] [Noise]

如果您有或想出了一个好的背景生成器或图像变换,请告诉我,以便将其添加到此处与其他人分享。

最终重要说明

两个 随机噪声图像,由于它们非常“随机”,因此是可以平铺的,我们使用“-virtual-pixels”来确保在变换过程中它们保持平铺。 但是,等离子体图像一开始就不是可平铺的,因此使用了一个放大的版本,其边缘“-shave”被切掉,用于去除许多操作中不需要的边缘效果。 这种技术在 修改图块图像 中有更详细的讨论。 请注意,最终的“-auto_level”应用于大多数图像,以增强结果的对比度,除非变换标记为不需要它,以保留由于变换而产生的颜色或阴影。 由于许多图像变换(如“-blur”、“-emboss”和“-edge”)是灰度变换,因此它们独立地作用于三个颜色通道。 因此,在许多图像中,结果看起来像是三个独立的图像叠加在一起,然后着色。 最终的例子“layered_levels”旨在同时作用于三个级别,同时保持它们分离,直到最终步骤,将它们加在一起并进行颜色着色。 通过应用初始灰度化操作,或在完成时仅提取一个通道,可以去除这种三重效果。 通常,我会提取“green”或“G”通道,因为它通常是灰度图像中最强的通道,尽管可以使用任何三个通道。