在 Gimp script-fu 中,如何访问 QuickMask 功能?
在 Gimp GUI 中,QuickMask 对于很多事情都非常有用,但此功能似乎不能通过 script-fu 直接使用。在程序浏览器中我没有看到明显的等价物。
特别是,将图层的(值/灰色)像素放入选择蒙版中是我需要做的基本事情。我尝试使用 gimp-image-get-selection 获取选择通道的 id 号,然后 gimp-edit-paste 进入其中,但以下锚点操作导致 Gimp 崩溃。
In the Gimp GUI, the QuickMask is very useful for many things, but this functionality doesn't seem to be directly available through script-fu. No obvious equivalents were apparent to me in the procedure browser.
In particular, putting the (value/gray) pixels of a layer into the selection mask is the basic thing I need to do. I tried using gimp-image-get-selection to get the selection channel's id number, then gimp-edit-paste into it, but the following anchor operation caused Gimp to crash.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的另一个答案包含“理论”的做法 - 然而,OP 在 GIMP 中发现了一个错误,从版本 2.6.5 开始,正如对该答案的评论中所示。
我得到了OP打算做的解决方法:将给定图像层的内容粘贴到图像选择中。如前所述,编辑-复制->在选择的可绘制对象上进行编辑粘贴会触发程序崩溃。
解决方法是通过复制粘贴方法创建一个包含所需内容的新图像通道,然后使用 gimp-selection-load 使选择内容等于通道内容:
因此需要调用的函数是(我赢了)不要粘贴方案代码,因为我不熟悉所有括号 - 我使用 GIMP 中的 Python 控制台进行了测试):
My other answer contains the "theoretical" way of doing it - however, the O.P. found a bug in GIMP, as of version 2.6.5, as can be seem on the comments to that answer.
I got a workaround for what the O.P. intends to do: paste the contents of a given image layer to the image selection. As denoted, edit-copy -> edit-paste on the selection drawable triggers a program crash.
The workaround is to create a new image channel with the desired contents, through the copy and paste method, and then use gimp-selection-load to make the selection equal the channel contents:
The functions that need to be called are thus (I won't paste scheme code, as I am not proficient in all the parenthesis - I did the tests using the Python console in GIMP):
通过用户界面使用 QuickMask 与在选区上绘制完全相同,将选区视为可绘制对象。
因此,要在 script-fu 上使用“quickmask”的等效项,只需将 Selection 作为可绘制对象检索,并将其作为参数传递给将修改它的调用 -
要获得选择,只需调用“gimp-image-get-selection”
Using QuickMask through the User interface is exactly equivalent to draw on the Selection, treating the selection as a drawable object.
So, to use the equivalent of "quickmask" on script-fu all one needs to is to retrieve the Selection as a drawable and pass that as a parameter to the calls that will modify it -
And to get the selection, one just have to call 'gimp-image-get-selection'