Add more zoom depth

Issue #1 resolved
fdubos created an issue

Hello Zlatko,

First of all, thanks a lot for this marvelous script I desperatly look for all over the Net without success, until I found your work. I don't use Photoshop, and don't want to use it, so I was really glad to see someone did create a plugin to use Leaflet tiles with the Gimp.

I'm not very gifted with python, though, and I'm a bit limited by the 6 degrees zoom. But finding a way to increase it by modifying the python file is quite far above my skills. Would it be possible to change this, by letting the user choose the level of zoom he wants ? And therefore the number of folders and subfolders.

Thanks again !

François.

Comments (8)

  1. Zlatko Masek repo owner

    Hi, @fdubos,

    Thanks for the kind words. I can make the zoom levels more flexible. It should be done by Monday, but I can have a working version most likely tomorrow by the end of the day. What image dimensions are you working with?

    Regards

  2. fdubos reporter

    Hello Zlatko, thanks for this very quick answer.

    Don't worry, there is no hurry in my request. I'm working with quite big pictures, about 4000px², and 300/400 pix resolution. I think the detail level would be perfect with a 10 or 12 levels of zoom.

    Sorry for my rusty english ! And thanks again for your work.

  3. Zlatko Masek repo owner

    Hi, @fdubos ,

    I have the code ready but I'll have to test it back home tomorrow. In the meantime, you can check the original post for this: http://www.offsetlab.net/gimp-and-leaflet/ I mentioned that on big dimensions it can be a bit painful depending on the amount of RAM you have. No worries about the language. It's not my mother tongue either :)

    Regards

  4. fdubos reporter

    Hi,

    Indeed, I understand the problem about RAM limitation. I noticed my computer had some difficulties with a 6 levels of zoom, maybe I'd have bad surprises when trying something more difficult. If you have some time however, I'd be interested in testing the code anyway.

  5. Zlatko Masek repo owner

    Hi, @fdubos,

    I increased the zoom level to 8 which is the maximum for the JPEG image (65536x65536). The new code is up if you want to take it for a spin (and have enough resources). Otherwise, we might work something out if you need to process more images in some other way. e.g. using PIL or Pillow library or splitting images beforehand and mass renaming or something... You'd need to describe what you're trying to achieve more...

    Regards

  6. fdubos reporter

    Hi,

    Thanks a lot for this, sincerely. I'll go on for new tests this week, and you'll have some feedback.

    I really understand your point of view. I spent a part of the afternoon trying to hack the process by splitting the original picture and renaming the folders. It doesn't work very well for now but I keep testing.

    I also try to understand what I'd like to get, and I think a picture of 12 levels of zoom could be good, since it would give a 256x12 px = 3072² px picture at first hand. I'll make some tests about this too this week, and give you feedback as well.

    Thanks again for your precious help,

    François.

  7. Zlatko Masek repo owner

    Hi, @fdubos,

    I understand your confusion now. The zoom levels by default are exponential, not linear. So is the tiling and the insane requirements in RAM. This means that by default zoom 0 is 256x256, zoom 1 is 512x512, zoom 2 is 1024x1024... not 768x768. Leaflet zooming example better explains this. The GIMP plug-in will work properly with the tiling, however, zooming with Leaflet will be a problem. Zooming with fractions might be a solution as is explained on the mentioned page. If you're working with 4096x4096, the maxZoom would be 4 (starting from zero). However, if you put in the fractional zoom (zoomSnap, zoomDelta properties), you will hopefully get what you need. I.e. more zooming levels, but the tiles remain the right size.

    Let me know if this helps.

  8. Log in to comment