5

i'm having a large jpg, which has a resolution of x * 256 / x * 256. I want to cut this image into 256x256 tiles with a naming convention {zoom}-{x}-{y}.jpg. In the past i've used ZoomifyExpress Converter which does the cutting and zooming. I also want 6 different zoom levels. I've started so far with this command:

convert example.jpg -crop 256x256 +gravity -set filename:tile ./tiles/%[fx:page.x/256]-%[fx:page.y/256] %[filename:tile].jpg

This produces a lot of x-y.jpg tiles.I don't know how i can add different zoomlevels. I'm relativly new to ImageMagick and this feels like a basic thing to do. Hopefully somebody can help me out. Thanks in advance.

kukudas
  • 4,834
  • 5
  • 44
  • 65
  • 1
    Please spend a little time checking your question for basic errors if you expect people to spend their time answering. Do you mean 250x250 or 256x256? What are the first few names actually produced? What is your input image size? What is {zoom} and zoom-level, they don't appear in your IM command? Thank you. – Mark Setchell Oct 09 '14 at 07:52
  • You're right. This actually fixes my first problem. I can't believe that i didn't recognize the wrong resolution my self. I've edited the question. Thank you. The zoom-level does not appear because i don't know how to do it. – kukudas Oct 09 '14 at 08:51
  • What do you mean by `zoom level` - what is it? Can you give an example with input and output images so I can understand what you are trying to do? – Mark Setchell Oct 09 '14 at 08:57

1 Answers1

6

I found the solution:

I just resize the image to the appropriate size and then crop it. The first number in the filename is the zoom level.

convert example.jpg -resize 256x256 -crop 256x256 -set filename:tile ./tiles/0-%[fx:page.x/256]-%[fx:page.y/256] %[filename:tile].jpg

convert example.jpg -resize 512x512 -crop 256x256 -set filename:tile ./tiles/1-%[fx:page.x/(256)]-%[fx:page.y/(256)] %[filename:tile].jpg

.. and so on until i reach the highest resolution.

kukudas
  • 4,834
  • 5
  • 44
  • 65