简体   繁体   中英

Resize image and create 3x3 tiles with ImageMagick

I managed to make tiles with ImageMagick like this:

-size 900x900 tile:D:\tile.jpg D:\tiles.jpg

But i want to resize the image before the tiling (300*300px) - and then maybe afterwards apply a sharpen, but the most important is the resizing. How do i do that in one command line?

Work from a simple command like this...

convert D:\tile.jpg -resize 300x300 -write mpr:tiler +delete ^
   -size 900x900 tile:mpr:tiler -sharpen 0x2 D:\tiles.jpg

That starts by reading in your "tile.jpg" image and resizes it to 300x300. Then it writes that resized image to an ImageMagick built-in memory register named "mpr:tiler" and deletes it from the current list. (You can name it "mpr:almost_anything".)

Next the command sets a canvas size of 900x900 and creates a tiled canvas filled with that "mpr:tiler" image.

You can add sharpening and other operations after reading in the input image and before writing it to the memory register, or after creating the tiled image and before writing it to an output file.

The command above is in Windows syntax. To run it in *nix change that continued-line caret "^" to a backslash "\\". If you're using ImageMagick v7 replace "convert" with "magick".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM