Code: Select all
convert "lenna256x256.png" -verbose -crop "170x180" \
-background blue \
-extent "170x180" \
-format "jpg" -quality 60 \
-set filename:f "./temp_dir/rgba|%[fx:w]x%[fx:h]|%[fx:page.width]x%[fx:page.height]|%[fx:page.x/170]_%[fx:page.y/180]" \
"%[filename:f].jpg"
So far so good, tiles of same sizes are created.
However, problem is with page.x and page.y because I cannot create correct naming. What I got from verbose is this:
Code: Select all
lenna256x256.png=>./temp_dir/rgba|170x180|256x256|0_0.jpg[0] PNG 256x256=>170x180 256x256+0+0 8-bit Grayscale Gray 4039B 0.063u 0:00.062
lenna256x256.png=>./temp_dir/rgba|170x180|506x256|1.97647_0.jpg[1] PNG 256x256=>170x180 506x256+336+0 8-bit sRGB 2516B 0.047u 0:00.042
lenna256x256.png=>./temp_dir/rgba|170x180|256x606|0_2.36667.jpg[2] PNG 256x256=>170x180 256x606+0+426 8-bit sRGB 2614B 0.031u 0:00.031
lenna256x256.png=>./temp_dir/rgba|170x180|506x606|1.97647_2.36667.jpg[3] PNG 256x256=>170x180 506x606+336+426 8-bit sRGB 1614B 0.015u 0:00.019