imagemagickimagemagick-convertimagemagick-montage

Creating Random Seamless Pattern using Imagemagick


Using imagemagick I am trying to create a similar image like this tile pattern: OUTPÙT

From this image: SOURCE

I can do simple tile by using:

convert table.png -write mpr:tile +delete -size 3000x3000 tile:mpr:tile table.jpg

However, is there any way to achieve the above result using imagemagick


Solution

  • Using ImageMagick you'll need to do some duplicating, rotating, and appending to get that result. Here's a simple IMv7 command that creates the tile with four tables...

    magick table.jpg ( +clone -rotate 90 ) +append ( +clone -rotate 180 ) -append tabletile.png
    

    That reads in the image of the single table, makes a clone inside the parentheses and rotates it 90 degrees.

    After the parentheses it appends that rotated clone horizontally to the original input image using "+append".

    Then inside parentheses again it makes a clone of that appended result and rotates it 180 degrees.

    Outside that parentheses it appends those two pieces vertically with "-append".

    Finish by writing the result to the output file.

    If you're using IMv6 use "convert" instead of "magick".

    If you're running that command on a *nix OS you'll probably need to escape those parentheses with backslashes "\(...\)".