Exemplos de ImageMagick -- Fundos
Exemplos de ImageMagick: Prefácio e Índice
Esta é uma tabela que aplica várias transformações a algumas telas 'aleatórias', mostrando métodos para produzir fundos aleatórios interessantes em qualquer tamanho desejado, seja uma única imagem grande, seja um ladrilho de fundo para uma página web. A tabela começa com o método usado para gerar a imagem 'aleatória' inicial, empregada para gerar todas as outras imagens mostradas. Basta inserir as várias 'transformações' de imagem no comando para converter, com o magick, a imagem bruta em algo semelhante ao que é exibido. A partir daí, você pode ajustar as diversas configurações por conta própria para produzir exatamente o tipo de imagem de fundo que quiser. Não deixe de ler as notas ao final antes de tentar criar seus próprios exemplos. E, por favor, envie por e-mail quaisquer variações interessantes que você venha a encontrar. Imagens de entrada :- Gerador, Transformação e Pós-processamento |
---|---
Os resultados de imagem mostrados aqui foram gerados com o operador de transformação nula "-noop"
Fractal de Plasma (imagem de tela não ladrilhável)
|
magick -size 120x120 plasma:fractal fractal.png
magick fractal.png _{..transform..}_ \
-shave 20x20 +repage -auto_level _{result}_
![[IM Output]](../static/img/backgrounds/fractal_noop.png)
Ruído Aleatório (imagem de fundo ladrilhável)
|
magick -size 80x80 xc: +noise Random noise.png
magick noise.png -virtual-pixel tile _{..transform..}_ \
-auto_level _{result}_
| ![[IM Output]](../static/img/backgrounds/noise_noop.png)
Ladrilho Hexagonal Aleatório (imagem de fundo em ladrilho hexagonal)
|
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]](../static/img/backgrounds/hextile_noop.png)
|
Transformações Básicas
blur_raw (sem -auto-level posterior) |
-blur 0x1
-blur 0x1
-blur 0x3
-blur 0x5
-blur 0x10
-blur 0x10 -colorspace Gray
-blur 0x10 -fx G
-blur 0x10 -auto-level -separate -background white \
-compose ModulusAdd -flatten -channel R -combine +channel \
-set colorspace HSB -colorspace RGB
|
| ![[Noise]](../static/img/backgrounds/hextile_hues.png)
Transformações de Sombreamento
shade_raw (sem -auto-level posterior) |
-shade 120x45
-shade 120x45
|
| ![[Noise]](../static/img/backgrounds/hextile_shade.png)
shade_dimmed (sem -auto-level posterior) |
-shade 120x45 -auto-level -fill grey -colorize 40%
-blur 0x1 -shade 120x45
-blur 0x2 -shade 120x45
-blur 0x5 -shade 120x45
-blur 0x10 -fx G -shade 120x45
|
| ![[Noise]](../static/img/backgrounds/hextile_shade_10.png)
Transformações de Relevo
emboss_1 |
-blur 0x5 -emboss 1
-blur 0x5 -emboss 1 -fx G
-blur 0x3 -emboss .5 -shade 120x45
-blur 0x5 -emboss 1 -shade 120x45
-blur 0x5 -emboss 1 -fx G -shade 120x45
-blur 0x10 -emboss 5 -fx G -shade 120x45
|
| ![[Noise]](../static/img/backgrounds/hextile_emboss_5gs.png)
Transformações de Bordas
charcoal |
-blur 0x2 -charcoal 10 -negate
-blur 0x2 -charcoal 10 -negate -shade 120x45
-blur 0x2 -charcoal 1 -negate -shade 120x45
-blur 0x2 -edge 10
-blur 0x2 -edge 10 -fx G
-blur 0x2 -edge 10 -fx G -shade 120x45
|
| ![[Noise]](../static/img/backgrounds/hextile_mesas.png)
Transformações Geradoras de Linhas
lines |
-blur 0x10 -emboss 4 -edge 1
-blur 0x10 -edge 15 -edge 1 -blur 0x1
-blur 0x10 -edge 15 -edge 1 -blur 0x1 -fx R+B+G -shade 280x45
-blur 0x10 -edge 15 -edge 1 -blur 0x1 -fx G -shade 280x45
-blur 0x10 -normalize -fx 'sin(u*4*pi)*100' -edge 1 -blur 0x1
-blur 0x10 -normalize -fx 'sin(g*4*pi)*100' \
-edge 1 -blur 0x1 -shade 280x45
|
| ![[Noise]](../static/img/backgrounds/hextile_contours.png)
Transformações Complexas de Manchas Texturizadas
(usando um estranho efeito '-edge 1')
blobs |
-blur 0x10 -edge 1
-blur 0x10 -edge 1 -fx '(R+G+B)/3'
-blur 0x10 -edge 1 -fx G -shade 280x45
-blur 0x10 \( +clone -negate \) -edge 1 -fx u.G+v.G -shade 280x45
-blur 0x10 -write mpr:save -negate -edge 1 -negate -fx G \
\( mpr:save -edge 1 -fx G \) -shade 280x45 -evaluate-sequence mean
|
| ![[Noise]](../static/img/backgrounds/hextile_mottled.png)
Transformações de Pintura
paint_raw10 (sem -auto-level posterior) |
-paint 10
-paint 10 -blur 0x5 -paint 10
-paint 10 -shade 120x45
-blur 0x5 -paint 8
-blur 0x5 -paint 8 -shade 120x45
-blur 0x10 -paint 3
-blur 0x10 -paint 3 -shade 120x45
-blur 0x10 -paint 3 \( +clone -shade 120x45 \) \
+swap -compose overlay -composite
|
| ![[Noise]](../static/img/backgrounds/hextile_paint_3d.png)
Transformações de Gradiente
levels (sem -auto-level posterior) |
-blur 0x12 -fx intensity -normalize \
-size 1x9 gradient:navy-lavender \
-interpolate integer -fx 'v.p{0,G*(v.h-1)}'
|
| ![[Noise]](../static/img/backgrounds/hextile_levels.png)
levels_3d (sem -auto-level posterior) |
-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
-blur 0x12 -normalize \
-size 1x19 pattern:gray50 -fx 'v.p{0,G*(v.h-1)}'
-blur 0x12 -normalize \
\( -size 1x9 xc: -draw 'color 0,4 point' -negate \) \
-fx 'v.p{0,G*(v.h-1)}'
|
| ![[Noise]](../static/img/backgrounds/hextile_midlevel.png)
edged_level (sem -auto-level posterior) |
-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'
|
| ![[Noise]](../static/img/backgrounds/hextile_edged_level.png)
layered_levels (sem -auto-level posterior) |
-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
-blur 0x5 -normalize -fx g \
-sigmoidal-contrast 15x50% -solarize 50%
Se você tiver ou vier a criar um bom gerador de fundos ou transformação de imagem, avise-me para que possa ser acrescentado aqui e compartilhado com os demais.
Notas Finais Importantes
As duas Imagens de Ruído Aleatório, por serem tão 'aleatórias', são ladrilháveis, e usamos "[-virtual-pixels](https://imagemagick.org/command-line-options/#virtual-pixels)" para garantir que permaneçam ladrilháveis durante a transformação. No entanto, a Imagem de Plasma não é ladrilhável de início, por isso emprega-se uma versão ampliada, com as bordas removidas depois usando "[-shave](https://imagemagick.org/command-line-options/#shave)", para eliminar o efeito de borda indesejado que muitas operações produzem. Essas técnicas são discutidas com mais detalhe em Modificação de Imagens de Ladrilho. Observe que o "[-auto_level](https://imagemagick.org/command-line-options/#normalize)" final é aplicado à maioria das imagens para realçar o contraste dos resultados, exceto quando a transformação está marcada como não o exigindo, de modo a preservar qualquer coloração ou sombreado resultante da transformação. Como muitas transformações de imagem, tais como "[-blur](https://imagemagick.org/command-line-options/#blur)", "[-emboss](https://imagemagick.org/command-line-options/#emboss)" e "[-edge](https://imagemagick.org/command-line-options/#edge)", são transformações em escala de cinza, elas atuam sobre os três canais de cor de forma completamente independente entre si. Como resultado, em muitas das imagens o efeito final parece que três imagens separadas foram sobrepostas e depois sombreadas. O último exemplo, "layered_levels", foi projetado para atuar em cada um dos três níveis simultaneamente, mantendo-os separados até a etapa final, na qual são somados e tingidos com cor. Esse efeito triplo pode ser removido aplicando-se uma operação inicial de conversão para escala de cinza ou extraindo apenas um dos canais ao final. Normalmente eu extraio o canal 'green' ou 'G', pois costuma ser o canal mais forte numa imagem em escala de cinza; ainda assim, qualquer um dos três canais pode ser usado.
![[Fractal]](../static/img/backgrounds/fractal_blur_raw.png)
![[Noise]](../static/img/backgrounds/noise_blur_raw.png)
![[Noise]](../static/img/backgrounds/hextile_blur_raw.png)
![[Fractal]](../static/img/backgrounds/fractal_blur_1.png)
![[Noise]](../static/img/backgrounds/noise_blur_1.png)
![[Noise]](../static/img/backgrounds/hextile_blur_1.png)
![[Fractal]](../static/img/backgrounds/fractal_blur_3.png)
![[Noise]](../static/img/backgrounds/noise_blur_3.png)
![[Noise]](../static/img/backgrounds/hextile_blur_3.png)
![[Fractal]](../static/img/backgrounds/fractal_blur_5.png)
![[Noise]](../static/img/backgrounds/noise_blur_5.png)
![[Noise]](../static/img/backgrounds/hextile_blur_5.png)
![[Fractal]](../static/img/backgrounds/fractal_blur_10.png)
![[Noise]](../static/img/backgrounds/noise_blur_10.png)
![[Noise]](../static/img/backgrounds/hextile_blur_10.png)
![[Fractal]](../static/img/backgrounds/fractal_intensity.png)
![[Noise]](../static/img/backgrounds/noise_intensity.png)
![[Noise]](../static/img/backgrounds/hextile_intensity.png)
![[Fractal]](../static/img/backgrounds/fractal_channel.png)
![[Noise]](../static/img/backgrounds/noise_channel.png)
![[Noise]](../static/img/backgrounds/hextile_channel.png)
![[Fractal]](../static/img/backgrounds/fractal_shade_raw.png)
![[Noise]](../static/img/backgrounds/noise_shade_raw.png)
![[Noise]](../static/img/backgrounds/hextile_shade_raw.png)
![[Fractal]](../static/img/backgrounds/fractal_shade_dimmed.png)
![[Noise]](../static/img/backgrounds/noise_shade_dimmed.png)
![[Noise]](../static/img/backgrounds/hextile_shade_dimmed.png)
![[Fractal]](../static/img/backgrounds/fractal_shade_1.png)
![[Noise]](../static/img/backgrounds/noise_shade_1.png)
![[Noise]](../static/img/backgrounds/hextile_shade_1.png)
![[Fractal]](../static/img/backgrounds/fractal_shade_2.png)
![[Noise]](../static/img/backgrounds/noise_shade_2.png)
![[Noise]](../static/img/backgrounds/hextile_shade_2.png)
![[Fractal]](../static/img/backgrounds/fractal_shade_5.png)
![[Noise]](../static/img/backgrounds/noise_shade_5.png)
![[Noise]](../static/img/backgrounds/hextile_shade_5.png)
![[Fractal]](../static/img/backgrounds/fractal_emboss_1.png)
![[Noise]](../static/img/backgrounds/noise_emboss_1.png)
![[Noise]](../static/img/backgrounds/hextile_emboss_1.png)
![[Fractal]](../static/img/backgrounds/fractal_emboss_1g.png)
![[Noise]](../static/img/backgrounds/noise_emboss_1g.png)
![[Noise]](../static/img/backgrounds/hextile_emboss_1g.png)
![[Fractal]](../static/img/backgrounds/fractal_emboss_0s.png)
![[Noise]](../static/img/backgrounds/noise_emboss_0s.png)
![[Noise]](../static/img/backgrounds/hextile_emboss_0s.png)
![[Fractal]](../static/img/backgrounds/fractal_emboss_1s.png)
![[Noise]](../static/img/backgrounds/noise_emboss_1s.png)
![[Noise]](../static/img/backgrounds/hextile_emboss_1s.png)
![[Fractal]](../static/img/backgrounds/fractal_emboss_1gs.png)
![[Noise]](../static/img/backgrounds/noise_emboss_1gs.png)
![[Noise]](../static/img/backgrounds/hextile_emboss_1gs.png)
![[Fractal]](../static/img/backgrounds/fractal_charcoal.png)
![[Noise]](../static/img/backgrounds/noise_charcoal.png)
![[Noise]](../static/img/backgrounds/hextile_charcoal.png)
![[Fractal]](../static/img/backgrounds/fractal_charcoal_10s.png)
![[Noise]](../static/img/backgrounds/noise_charcoal_10s.png)
![[Noise]](../static/img/backgrounds/hextile_charcoal_10s.png)
![[Fractal]](../static/img/backgrounds/fractal_charcoal_1s.png)
![[Noise]](../static/img/backgrounds/noise_charcoal_1s.png)
![[Noise]](../static/img/backgrounds/hextile_charcoal_1s.png)
![[Fractal]](../static/img/backgrounds/fractal_edges.png)
![[Noise]](../static/img/backgrounds/noise_edges.png)
![[Noise]](../static/img/backgrounds/hextile_edges.png)
![[Fractal]](../static/img/backgrounds/fractal_edge_grey.png)
![[Noise]](../static/img/backgrounds/noise_edge_grey.png)
![[Noise]](../static/img/backgrounds/hextile_edge_grey.png)
![[Fractal]](../static/img/backgrounds/fractal_lines.png)
![[Noise]](../static/img/backgrounds/noise_lines.png)
![[Noise]](../static/img/backgrounds/hextile_lines.png)
![[Fractal]](../static/img/backgrounds/fractal_loops.png)
![[Noise]](../static/img/backgrounds/noise_loops.png)
![[Noise]](../static/img/backgrounds/hextile_loops.png)
![[Fractal]](../static/img/backgrounds/fractal_engrave_loops.png)
![[Noise]](../static/img/backgrounds/noise_engrave_loops.png)
![[Noise]](../static/img/backgrounds/hextile_engrave_loops.png)
![[Fractal]](../static/img/backgrounds/fractal_engrave_loop.png)
![[Noise]](../static/img/backgrounds/noise_engrave_loop.png)
![[Noise]](../static/img/backgrounds/hextile_engrave_loop.png)
![[Fractal]](../static/img/backgrounds/fractal_color_contours.png)
![[Noise]](../static/img/backgrounds/noise_color_contours.png)
![[Noise]](../static/img/backgrounds/hextile_color_contours.png)
![[Fractal]](../static/img/backgrounds/fractal_blobs.png)
![[Noise]](../static/img/backgrounds/noise_blobs.png)
![[Noise]](../static/img/backgrounds/hextile_blobs.png)
![[Fractal]](../static/img/backgrounds/fractal_blobs_grey.png)
![[Noise]](../static/img/backgrounds/noise_blobs_grey.png)
![[Noise]](../static/img/backgrounds/hextile_blobs_grey.png)
![[Fractal]](../static/img/backgrounds/fractal_pits.png)
![[Noise]](../static/img/backgrounds/noise_pits.png)
![[Noise]](../static/img/backgrounds/hextile_pits.png)
![[Fractal]](../static/img/backgrounds/fractal_ridges.png)
![[Noise]](../static/img/backgrounds/noise_ridges.png)
![[Noise]](../static/img/backgrounds/hextile_ridges.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_raw10.png)
![[Noise]](../static/img/backgrounds/noise_paint_raw10.png)
![[Noise]](../static/img/backgrounds/hextile_paint_raw10.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_areas.png)
![[Noise]](../static/img/backgrounds/noise_paint_areas.png)
![[Noise]](../static/img/backgrounds/hextile_paint_areas.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_raw10s.png)
![[Noise]](../static/img/backgrounds/noise_paint_raw10s.png)
![[Noise]](../static/img/backgrounds/hextile_paint_raw10s.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_8.png)
![[Noise]](../static/img/backgrounds/noise_paint_8.png)
![[Noise]](../static/img/backgrounds/hextile_paint_8.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_8s.png)
![[Noise]](../static/img/backgrounds/noise_paint_8s.png)
![[Noise]](../static/img/backgrounds/hextile_paint_8s.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_3.png)
![[Noise]](../static/img/backgrounds/noise_paint_3.png)
![[Noise]](../static/img/backgrounds/hextile_paint_3.png)
![[Fractal]](../static/img/backgrounds/fractal_paint_3s.png)
![[Noise]](../static/img/backgrounds/noise_paint_3s.png)
![[Noise]](../static/img/backgrounds/hextile_paint_3s.png)
![[Fractal]](../static/img/backgrounds/fractal_levels_3d.png)
![[Noise]](../static/img/backgrounds/noise_levels_3d.png)
![[Noise]](../static/img/backgrounds/hextile_levels_3d.png)
![[Fractal]](../static/img/backgrounds/fractal_zebra.png)
![[Noise]](../static/img/backgrounds/noise_zebra.png)
![[Noise]](../static/img/backgrounds/hextile_zebra.png)
![[Fractal]](../static/img/backgrounds/fractal_layered_levels.png)
![[Noise]](../static/img/backgrounds/noise_layered_levels.png)
![[Noise]](../static/img/backgrounds/hextile_layered_levels.png)
![[Fractal]](../static/img/backgrounds/fractal_filaments.png)
![[Noise]](../static/img/backgrounds/noise_filaments.png)
![[Noise]](../static/img/backgrounds/hextile_filaments.png)