RSS/Atom feed Twitter
Site is read-only, email is disabled

Binary Search Zoom?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Binary Search Zoom? Smo 21 Feb 18:16
  Binary Search Zoom? rich404 22 Feb 11:46
   Binary Search Zoom? Smo 22 Feb 14:28
2019-02-21 18:16:35 UTC (about 5 years ago)
postings
2

Binary Search Zoom?

Hello all,

I did quite a bit of googling and couldn't find the answer to this. Can you control zoom percentage of an image with script-fu? It looks like some folks asked this question on gimptalk.org, but their server is down and it's not on archive.org.

What I'd like to do is speed up the zooming of an image to life scale. The images are at wildly inconsistent DPI but with a tape measure in the photo for scale. Right now we use manual binary search, but I'd like to add some automation by binding three keys to scripts - one key to press when the image is too large, one to press when it's too small, and another to press if you make a mistake and want to go back one step. Maybe a fourth to reset the search altogether.

It would require the ability to control zoom, and also the script would need to know the current boundaries of the search each time it's called. Since script-fu supports global variables I think the second part wouldn't be a problem.

I tried using a formula to measure dpi and zoom to scale, but I found it still required fine-tuning manually, and it was just as fast to do a binary search the whole way.

rich404
2019-02-22 11:46:39 UTC (about 5 years ago)

Binary Search Zoom?

Hello all,

I did quite a bit of googling and couldn't find the answer to this. Can you control zoom percentage of an image with script-fu? It looks like some folks asked this question on gimptalk.org, but their server is down and it's not on archive.org.

What I'd like to do is speed up the zooming of an image to life scale. The images are at wildly inconsistent DPI but with a tape measure in the photo for scale. Right now we use manual binary search, but I'd like to add some automation by binding three keys to scripts - one key to press when the image is too large, one to press when it's too small, and another to press if you make a mistake and want to go back one step. Maybe a fourth to reset the search altogether.

It would require the ability to control zoom, and also the script would need to know the current boundaries of the search each time it's called. Since script-fu supports global variables I think the second part wouldn't be a problem.

I tried using a formula to measure dpi and zoom to scale, but I found it still required fine-tuning manually, and it was just as fast to do a binary search the whole way.

These old gimp forums gimptalk.com, gimpforums.com...etc dead because owner abandoned / not maintained / only contain spam.

This is not the best forum for your question, it is linked to a mailing list which is unlikely to help. I can think of one actual gimpusers.com forum member here that might give scripting advice.

There are other forums, even reddit might get you somewhere. You have some very definite requirements, not too sure what you mean by a manual binary search, presumably looking at images to determine matching areas.

Using a tape measure to determine a scale? Depends on the images but you can do the same (perhaps with sufficient accuracy) with a path and in Gimp 2.10 using the handle transform tool. Easier scaling-down, but scaling-up is possible with some canvas resizing.

best of luck.

2019-02-22 14:28:25 UTC (about 5 years ago)
postings
2

Binary Search Zoom?

These old gimp forums gimptalk.com, gimpforums.com...etc dead because owner abandoned / not maintained / only contain spam.

This is not the best forum for your question, it is linked to a mailing list which is unlikely to help. I can think of one actual gimpusers.com forum member here that might give scripting advice.

There are other forums, even reddit might get you somewhere. You have some very definite requirements, not too sure what you mean by a manual binary search, presumably looking at images to determine matching areas.

Using a tape measure to determine a scale? Depends on the images but you can do the same (perhaps with sufficient accuracy) with a path and in Gimp 2.10 using the handle transform tool. Easier scaling-down, but scaling-up is possible with some canvas resizing.

best of luck.

Thanks - I asked in the GIMP subreddit, we'll see what happens.

What I mean by manual binary search is to zoom in/out until the image shows at scale. Something like this (note, numbers aren't exact binary search numbers because that would be too tedious to calculate, but you get the idea):

1) Image loads at 50% zoom. 2) Image is too big. Zoom to 33.3%.
3) Image is too small. Zoom to 44%.
4) Image is too big. Zoom to 40%.
5) Image is close but too small. Zoom to 40.5%

etc, until the image is life scale. It usually takes 10-15 steps. Not a big deal, but entering zoom percentages manually over and over gets tedious. It would be faster to just have "make it larger" and "make it smaller" buttons that worked in a binary search manner.

We aren't modifying the image in any way, just changing the zoom.