I have several input images that contain several smaller images, and they are all on the same line. All images contained are the same size. So, for example, the image input.pngmay also 480x48contain 10 48x48images, all in one line.
Using the imagemagick tool convert(or any other tool that comes with the defaul imagemagick package), I want to write a bash script that takes an input image, the number of images to cut, and then cuts them all into separate images.
User interaction, which I can do, but I could not get convertfor the actual cutting. Can anyone suggest something? From reading the manual pages, I think this should work:
convert 'input.png[0x0+48+48]' output.png
but I get an error:
convert: tb_icons_l.png' @
magick/cache.c/OpenCache/3572.
convert: No IDATs written into file
1.png '@ encoders /png.c/PNGErrorHandler/1391 pixels are not defined in the cache .
Any ideas?
source
share