5

每次我想知道 Gimp 中的图层尺寸时,我都会打开“缩放图层”对话框来获取它。有没有更好的方法一目了然?可能是一些配置选项,可以在图层名称的底部/右侧或底部栏中显示它...

也许这可能是 Gimp 功能请求?

谢谢!

4

1 回答 1

11

GIMP 确实有配置状态栏的方法(在首选项、图像窗口、标题和状态上) - 但目前无法显示图层大小 -

可以提出功能请求 - 一方面这是一项简单的任务,并且开始尝试与项目协作的人可能会解决它。另一方面,该项目缺乏开发人力,在路线图上,已经完全摆脱了“层维度”(未来他们应该只是自动扩展/收缩,在出口时有选择权用于在需要时固定尺寸)。无论如何,值得在 bugzilla.gnome.org 重新请求这个功能

现在以编程方式可以做的是编写一个小的 python 脚本,该脚本将使用文本输入小部件打开它自己的 GTK 窗口,并在脚本上设置一个主循环(GIMP 中的 python 插件在单独的进程中运行,所以它他们有自己的主循环是可以的) - 以一定的间隔调用一些东西:

层 = pdb.gimp_image.get_active_layer(img) 宽度 = layer.width; 高度 = 层.高度

并将这些值输入您的窗口。“img”参数将在您启动插件时传递,并且您必须为每个工作图像运行它的一个实例。(没有 PDB 调用来获取 GIMP 中的活动图像)。

更新 在 OP 打开错误请求后,该功能在 GIMP 的开发分支中实现,并且可作为 %x 和 %y 代码用于 GIMP git master 的状态/标题栏中(编辑->首选项- >图像窗口->标题和状态)。它应该从 GIMP 2.10 开始可用。

更新 我发现除了检查源代码之外,没有简单的方法可以了解状态栏的可用代码。所以我把它们贴在这里:

%f: base filename
%F: full filename
%p: PDB id
%i: instance
%t: image type
%T: drawable type
%s: user source zoom factor
%d: user destination zoom factor
%z: user zoom factor (percentage)
%D: dirty flag
%C: clean flag
%B: dirty flag (long)
%A: clean flag (long)
%m: memory used by image
%M: image size in megapixels
%l: number of layers
%L: number of layers (long)
%n: active drawable name
%P: active drawable PDB id
%W: width in real-world units
%w: width in pixels
%H: height in real-world units
%h: height in pixels
%u: unit symbol
%U: unit abbreviation
%X: drawable width in real world units
%x: drawable width in pixels
%Y: drawable height in real world units
%y: drawable height in pixels
%o: image's color profile name
%e: view offsets in pixels
%r: view rotation angle in degrees

(请注意,其中一些可能在 GIMP 2.8 中不可用)

于 2013-08-05T11:40:10.453 回答