layer - 如何快速知道 Gimp 中的图层尺寸?

标签 layer dimensions gimp

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

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

谢谢!

最佳答案

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

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

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

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

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

更新
在 OP 打开 bug 请求后,该功能在 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 中可能不可用)

关于layer - 如何快速知道 Gimp 中的图层尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18042093/

相关文章:

iOS 如何删除细边框线然后使用 layer.cornerRadius

sql-server-2008-r2 - SSAS - 时间维度增加的时间结构

image - 在 GIMP 中仅编辑 Alpha 图层

cocoa - 用新鲜的背景合成图像?

java - 国际象棋分层问题

javascript - window.screen.width/height 不应该对应于实际的屏幕宽度/高度吗?

android - 处理所有屏幕尺寸的android

ubuntu - 为什么 GIMP 脚本在 CLI 模式下不起作用?

python - Gimp,python-fu : RuntimeError: execution error in pdb. gimp_image_merge_down

architecture - 在 DDD + 分层架构中实现 Automapper 的位置