Gimp-Forum.net
Translate selected pixels in layer - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Translate selected pixels in layer (/Thread-Translate-selected-pixels-in-layer)



Translate selected pixels in layer - c_______z______ - 07-13-2022

Hi, I am brand new to gimp scripting and still figuring out the basics. I'd like to find out how to perform a translation on only the pixels of a layer that are within a selection. Basically the equivalent of doing this in the UI: perform selection, hold down Ctrl-Alt, then click and drag.

I can create a selection just fine, but I don't know how to turn the pixels inside the selection into a floating selection. I assume once I do that, I can just use gimp-item-transform-translate on the floating selection?

Thanks!

I figured it out: the procedure to use is gimp-selection-float, which performs the translation as well. Just pass in the desired layer as the drawable