How to crop to multiple images using GraphicsMagick

According to the GraphicsMagick graphics page, I can create multiple fragments from an image using crop without offset.

On the man page for cropping: "If the gaps x and y are omitted, a set of tiles of the specified geometry is created that spans the entire input image. The rightmost tiles and lower tiles are smaller if the specified geometry is outside the size of the input image."

So, I ran the following command (on linux):

gm convert -crop 256x256 input.png tile => created a single file called tile

gm convert -crop 256x256 input.png tile.png => created a single file called tile.png

How to specify output to create multiple images?

+4
source share
1 answer

I found the answer ...

gm convert -crop 256x256 input.png + adjoin tile% 04d.png

The + symbol is the key

+5
source

All Articles