画像をずらしながらタイル状に並べる

2024年12月8日

少し工夫が必要です

2つ目は背景が透明な画像を準備してください

最小パターン

最小パターン

最小パターン

ImageMagick

C:\app\ImageMagick\magick "D:\waga\ex.png" -resize 100% ^
  -size  %%[fx:w]x%%[fx:h] xc:#BBFFFF +swap -gravity center -compose over -composite ^
  ( -clone 0 -roll +0+%%[fx:h/2]  ) +append -write mpr:TILE +delete ^
  -size 1000x1000 tile:mpr:TILE "Y:\exit20.png"

C:\app\ImageMagick\magick "D:\waga\ex.png" -resize 100% ^
  -size  %%[fx:w]x%%[fx:h] xc:#BBFFFF +swap -gravity center -compose over -composite ^
  ( -clone 0 -roll +0+%%[fx:h/2]  ) +append  "Y:\exit2.png"


C:\app\ImageMagick\magick "D:\waga\ex.png" -resize 100%% ^
  -roll  +%%[fx:w/2]+%%[fx:h/2] -background none -gravity west -write mpr:MODIFIED +delete ^
  mpr:MODIFIED "D:\waga\ex.png" -resize 100%% ^
  -gravity center -compose over -composite ^
  "Y:\exit.png"


C:\app\ImageMagick\magick "D:\waga\ex.png" -resize 100%% ^
  -roll  +%%[fx:w/2]+%%[fx:h/2] -background none -gravity west -write mpr:MODIFIED +delete ^
  mpr:MODIFIED "D:\waga\ex.png" -resize 100%%   -gravity center -compose over -composite -write mpr:TILE +delete ^
  -size 1000x1000 tile:mpr:TILE   "Y:\exit22.png"


C:\app\ImageMagick\magick "D:\waga\ex.png" -resize 100%% ^
  -background none -gravity east -extent %%[fx:1.5*w]x%%[fx:h] -roll  +%%[fx:8*w/6]+%%[fx:h/2] ^
-write mpr:BACKGROUND +delete   mpr:BACKGROUND "D:\waga\ex.png" -gravity center -composite  "Y:\output.png"


C:\app\ImageMagick\magick "D:\waga\ex.png" -resize 100%% ^
  -background none -gravity east -extent %%[fx:1.5*w]x%%[fx:h] -roll  +%%[fx:8*w/6]+%%[fx:h/2] ^
-write mpr:BACKGROUND +delete   mpr:BACKGROUND "D:\waga\ex.png" -gravity center -composite  -write mpr:TILE +delete ^
  -size 1000x1000 tile:mpr:TILE     "Y:\output5.png"


timeout /t 55&goto:eof

タイル

タイル

タイル

参考

[応用編] Imagemagickを使ってテキスタイルパターンを作る | | Imagemagickの使い方日本語マニュアル

一括バッチファイル

md y:\input_png

SETLOCAL enabledelayedexpansion
for /r "D:\waga" %%f in (*.png) do (


  C:\app\ImageMagick\magick "%%f" -resize 100% ^
    -size %%[fx:w]x%%[fx:h] xc:none +swap -gravity center -compose over -composite ^
    ^( -clone 0 -roll +0+%%[fx:h/2] ^) +append "y:\input_png\%%~nf_2.png"

  C:\app\ImageMagick\magick "%%f" -resize 100%% ^
    -roll +%%[fx:w/2]+%%[fx:h/2] -background none -gravity west -write mpr:MODIFIED +delete ^
    mpr:MODIFIED "%%f" -resize 100%% ^
    -gravity center -compose over -composite ^
    "y:\input_png\%%~nf_3.png"

  C:\app\ImageMagick\magick "%%f" -resize 100%% ^
    -background none -gravity east -extent %%[fx:1.5*w]x%%[fx:h] -roll +%%[fx:8*w/6]+%%[fx:h/2] ^
    -write mpr:BACKGROUND +delete mpr:BACKGROUND "%%f" -gravity center -composite "y:\input_png\%%~nf_4.png"
)
timeout /t 55&goto:eof

imagemagick

Posted by eightban