Gimp-Forum.net
Command/API to move to particular coordinate? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Command/API to move to particular coordinate? (/Thread-Command-API-to-move-to-particular-coordinate)



Command/API to move to particular coordinate? - Ken Shirriff - 05-06-2022

Is there a command / plugin / API that will center the window on a particular coordinate? E.g. I enter 2000, 3000 and it moves the window to that coordinate.

My use case is that I have a 10000x10000 image and a list of coordinates where I need to fix things. Currently I scroll, then stop to read the cursor position in the lower left, scroll some more, and repeat until I find the desired location, which is tedious. I'd like to be able to jump directly to a position.I looked through script fu but couldn't figure out if there is a  better way.

Thanks!


RE: Command/API to move to particular coordinate? - tmanni - 05-06-2022

The only way I see to do this is a 2 steps process to repeat for each location:
- use the rectangle select tool : set manually it's size and position in the tool options to center it on the location
- then menu View > Zoom > Zoom to selection


RE: Command/API to move to particular coordinate? - rich2005 - 05-06-2022

It might be a good request to the Gimp developers for a center view at X,Y or there might already be one, I do not know.

Quote:My use case is that I have a 10000x10000 image and a list of coordinates where I need to fix things..

Fix things ? Fix what at...where ?

There are scripts/plugins that will take a list of coordinates and set-up guides that can be used to centre layers.

If it is a copied image / selection /... then there is a python plugin that will paste into @ X,Y coordinates.  

Might be useful, attached. Unzip. paste-xy.py  It should work with MacOS goes in your Gimp user plugins folder, wherever that is in MacOS. Check that it is executable.

Works like this: https://i.imgur.com/5A6wHSd.mp4  Not centered, standard graphics, X,Y is top left corner.


RE: Command/API to move to particular coordinate? - Ofnuts - 05-06-2022

(05-06-2022, 04:57 PM)Ken Shirriff Wrote: Is there a command / plugin / API that will center the window on a particular coordinate? E.g. I enter 2000, 3000 and it moves the window to that coordinate.

My use case is that I have a 10000x10000 image and a list of coordinates where I need to fix things. Currently I scroll, then stop to read the cursor position in the lower left, scroll some more, and repeat until I find the desired location, which is tedious. I'd like to be able to jump directly to a position.I looked through script fu but couldn't figure out if there is a  better way.

Thanks!

No way. Script and plugins are by design barred from interacting with the UI.


RE: Command/API to move to particular coordinate? - Ken Shirriff - 05-13-2022

Thanks everyone for the suggestions. timanni: your idea of selecting and then zooming solves my problem. I added a keyboard shortcut for zooming, which makes it even easier. rich2005: you asked what I'm fixing. I'm fixing layout problems on a chip image.