Page 1 of 1
Split image into large tiles?
Posted: 2019-10-14T03:55:20-07:00
by mattyrb
I'm using the following command on a 216 x 8880 image
magick convert frames.png -crop 216x120 tiles/tile%04d.png
Unfortunately it only outputs one image at 216x120.
Could someone tell me what I am doing wrong?
Re: Split image into large tiles?
Posted: 2019-10-14T05:38:28-07:00
by snibgo
What version of IM, on what platfom?
If your platfom is Windows BAT, you need to double the %.
Re: Split image into large tiles?
Posted: 2019-10-14T05:42:36-07:00
by mattyrb
version 7.0.8-68 x64. I'm literally running it at command prompt in Windows 10 but it only seems to produce 1 image and not do the entire image?
Re: Split image into large tiles?
Posted: 2019-10-14T06:06:45-07:00
by snibgo
What is the name of the file it makes? What does identify say about it?
Re: Split image into large tiles?
Posted: 2019-10-14T06:13:33-07:00
by mattyrb
The file created is tile000.png it's doing the first 216x120 piece of the image. I get the impression it's just not continuing down the file.
Re: Split image into large tiles?
Posted: 2019-10-14T06:35:00-07:00
by snibgo
Your command works fine for me, using v7.0.8-64 on Windows 8.1.
I suggest you use "magick", not "magick convert". The usual Windows directory separator is backslash \ not forward-slash /. However, these make no difference for me.
What does identify say about your input frames.png? Please post the text output of "magick identify frames.png".
Try wriing to "info:" as the output filename:
Code: Select all
magick frames.png -crop 216x120 info:
Does the text output show one image, or many images?
How about a new input:
Code: Select all
magick -size 216x8880 xc: -crop 216x120 info:
Re: Split image into large tiles?
Posted: 2019-10-14T06:41:20-07:00
by mattyrb
info: frames.png PNG 216x8880 216x120+0+0 8-bit sRGB 3.5611MiB 0.000u 0:00.000
magick frames.png -crop 216x120 tile%03d.png :info
magick: unable to open image 'tile%03d.png': No such file or directory @ error/blob.c/OpenBlob/3497.
Re: Split image into large tiles?
Posted: 2019-10-14T06:51:12-07:00
by snibgo
mattyrb wrote:magick frames.png -crop 216x120 tile%03d.png :info
magick: unable to open image 'tile%03d.png': No such file or directory @ error/blob.c/OpenBlob/3497.
That command is garbage. Try the commands I showed you.
mattyrb wrote:info: frames.png PNG 216x8880 216x120+0+0 8-bit sRGB 3.5611MiB 0.000u 0:00.000
That's the problem. Your image is 216x8880 but on a virtual canvas of only 216x120 pixels. The cure is to "+repage" after reading the input:
Code: Select all
magick frames.png +repage -crop 216x120 tiles\tile%04d.png
Re: Split image into large tiles?
Posted: 2019-10-14T06:53:28-07:00
by mattyrb
snibgo wrote: ↑2019-10-14T06:51:12-07:00
mattyrb wrote:magick frames.png -crop 216x120 tile%03d.png :info
magick: unable to open image 'tile%03d.png': No such file or directory @ error/blob.c/OpenBlob/3497.
That command is garbage. Try the commands I showed you.
mattyrb wrote:info: frames.png PNG 216x8880 216x120+0+0 8-bit sRGB 3.5611MiB 0.000u 0:00.000
That's the problem. Your image is 216x8880 but on a virtual canvas of only 216x120 pixels. The cure is to "+repage" after reading the input:
Code: Select all
magick frames.png +repage -crop 216x120 tiles\tile%04d.png
Works perfectly! Thank you so much for your help!