tot*_*ico 35
恐怕 Gimp 不包括它,因为它很乏味。在设计时,这根本不是对齐元素的适当方式,尽管我认识到有时它作为捷径很有用。无论如何,最好(正确)的方法是使用指南:
A) 第 1 步 - 创建指南
或者,您也可以创建从标尺拖动的参考线:
B) 第 2 步 - 移动画布
您可以使用移动工具。
设计原则之一是您应该在整个项目中保持一致。减少对齐(参考线)的数量有助于您获得更简洁的设计。我认为这就是 gimp 不包含指定精确坐标的工具的原因。如果要遵循这个设计原则,一个一个地指定精确坐标就变得很乏味了。
Dav*_*vid 27
Relative to
Image
。Offset
字段中输入 X。Distribute
/Offset
字段中输入 Y。Distribute
/就是这样!
小智 20
有一个脚本可以执行此操作,可以从 GIMP 插件注册表下载。它被称为:
将脚本移动到%USERPROFILE\.gimp-2.8\scripts
Windows、~/Library/Application Support/GIMP/2.8/scripts
OS X 或~/.gimp-2.8/scripts
Linux上的目录。(官方说明)
点击Filters
-> Script-Fu
-> Refresh scripts
。
新菜单项将出现在Layer
菜单底部Move to
。
小智 12
我正在使用 GIMP 2.6.11。
使用 Python 的这些行,活动层可以从 Python 控制台移动到绝对位置,如 (32, 64):
>>> x_new = 32
>>> y_new = 64
>>> img = gimp.image_list()[0]
>>> layer = img.layers[0]
>>> x_off, y_off = layer.offsets
>>> pdb.gimp_layer_translate(layer, x_new - x_off, y_new - y_off)
Run Code Online (Sandbox Code Playgroud)
或者你可以更简单地使用gimp_layer_set_offsets
像:
pdb.gimp_layer_set_offsets(layer, x_new, y_new)
Run Code Online (Sandbox Code Playgroud)
或者,如果您只想移动图层的内容:
右键单击,图层 -> 变换 -> 偏移
或Shift+ Ctrl+ O。
自 Gimp v.2.10 以来,有一种非常方便的方法可以做到这一点:
双击要移动的图层(或右键单击它并选择“编辑图层属性”)
将显示“编辑图层属性”对话框,您可以在那里根据需要更改 X/Y 偏移
就这么简单!:)
编辑:
正如@Michael 在对我的回答的评论中询问的那样,我正在添加一个脚本,该脚本将按指定的 x,y 偏移量移动所有图像层。
要使其工作,您需要在 Gimp 脚本文件夹中创建一个文件(如果需要,请参考: 或者
) 具有以下内容:
; This script is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This script is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;; Command is installed in "Layer->Move all layers..."
;;
;; The purpose of this script is to move all image layers by specified x,y offsets
;; X and Y offset parameters must be provided (use integer numbers as values)
;;
(define (dn-move-all-layers orig-image drawable
x-offset y-offset)
(define (get-all-layers img)
(let* (
(all-layers (gimp-image-get-layers img))
(i (car all-layers))
(bottom-to-top ())
)
(set! all-layers (cadr all-layers))
(while (> i 0)
(set! bottom-to-top (append bottom-to-top (cons (aref all-layers (- i 1)) '())))
(set! i (- i 1))
)
bottom-to-top
)
)
(define (move-layer orig-image layer-id offset-x offset-y)
(gimp-layer-set-offsets
layer-id
offset-x
offset-y
)
)
(let* (
(layers nil)
(layerpos 1)
(layer-id "")
(x-os 0)
(y-os 0)
(orig-selection 0)
)
(gimp-image-undo-disable orig-image)
(set! orig-selection (car (gimp-selection-save orig-image)))
(gimp-selection-none orig-image)
(set! x-os x-offset)
(set! y-os y-offset)
(set! layers (get-all-layers orig-image))
(while (pair? layers)
(move-layer orig-image (car layers) x-os y-os)
(set! layers (cdr layers))
(set! layerpos (+ layerpos 1))
)
(gimp-displays-flush)
(gimp-selection-load orig-selection)
(gimp-image-remove-channel orig-image orig-selection)
(gimp-image-undo-enable orig-image)
)
)
(script-fu-register "dn-move-all-layers"
"Move all layers..."
"Move each layer by specified x,y offsets."
"danicotra"
"danicotra"
"08/08/2019"
""
SF-IMAGE "Input image" 0
SF-DRAWABLE "Drawable" 0
SF-VALUE "X offset" "0"
SF-VALUE "Y offset" "0"
)
(script-fu-menu-register "dn-move-all-layers"
"<Image>/Layer/")
Run Code Online (Sandbox Code Playgroud)
如果你做对了,你会在“图层”菜单中找到一个名为“移动所有图层...”的新命令,启动它,会出现一个对话框,让你决定 X 和 Y 偏移。就是这样。
归档时间: |
|
查看次数: |
73786 次 |
最近记录: |