优化命令行 GIMP

发布于 2025-01-03 16:36:31 字数 122 浏览 4 评论 0原文

我正在从命令行使用 GIMP 运行 script-fu 宏。然而,它的启动和运行速度相当慢——大约20-25秒。我认为大部分时间都花在启动上 - 加载所有插件等。有哪些方法可以在 CL 上优化 GIMP?有什么办法让它一直运行吗?

I am running a script-fu macro using GIMP from the command line. However, it is quite slow to startup and run - about 20-25 seconds. I think a lot of this time is spent on startup - loading all the plugins and such. What are some ways to optimize GIMP on the CL? Is there any way to keep it always running?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

腹黑女流氓 2025-01-10 16:36:31

GIMP 文档 中的一些有前途的选项(其中一些您可能已经正在使用):

--no-interface:在没有用户界面的情况下运行。
--no-data:不加载图案、渐变、调色板或画笔。在需要最小化启动时间的非交互式情况下通常很有用。
--no-fonts:不加载任何字体。这对于为不使用字体的脚本更快地加载 GIMP 或查找与挂起 GIMP 的格式错误的字体相关的问题很有用。
--no-splash:启动时不显示闪屏。

GIMP 常见问题解答

GIMP 加载时间太长 - 如何加快加载速度?

主要是确保您运行的版本至少为 1.0,并确保您在编译时打开了优化、关闭了调试,并打开了共享内存和 X 共享内存选项。

或者,购买速度更快、内存更多的系统。 8^)

这个关于超级用户的问题解决了一般情况下 GIMP 启动时间慢的问题,并建议:

  • 通过删除 C:\Documents and Settings\<用户名>\.fonts-cache1 然后打开 GIMP。
  • 通过使用 --verbose 启动并查看其挂起的位置来检查加载缓慢的插件。然后通过在 C:\Program Files\GIMP-2.0\lib\gimp\\plug-ins 中重命名有问题的插件来删除它们。或者,通过重命名整个插件文件夹来删除所有插件。

Some promising options from the GIMP docs (some of which you may already be using):

--no-interface: Run without a user interface.
--no-data: Do not load patterns, gradients, palettes, or brushes. Often useful in non-interactive situations where start-up time is to be minimized.
--no-fonts: Do not load any fonts. This is useful to load GIMP faster for scripts that do not use fonts, or to find problems related to malformed fonts that hang GIMP.
--no-splash: Do not show the splash screen while starting.

The GIMP FAQ:

The GIMP takes too long to load - how can I speed it up?

The main things are to make sure you are running at least version 1.0, and make sure you compiled with optimization on, debugging turned off, and the shared memory and X shared memory options turned on.

Or, buy a faster system with more memory. 8^)

This question on SuperUser addresses slow GIMP startup time in general and recommends:

  • Rebuild the font cache file by deleting C:\Documents and Settings\<username>\.fonts-cache1 and then opening GIMP.
  • Check for slow-loading plugins by starting up with --verbose and seeing where it hangs. Then remove problematic plugins by renaming them in C:\Program Files\GIMP-2.0\lib\gimp\<version>\plug-ins. Alternately, remove all plugins by renaming the whole plugins folder.
笑脸一如从前 2025-01-10 16:36:31

与其说是一种解决方案,不如说是未来的一种不同的可能性,但是您是否考虑过不使用 GIMP?

GIMP 首先是一个基于 GUI 的应用程序。如果您从命令行进行大量重复的图像操作,那么使用 ImageMagick 专为此类用途而设计。我不知道你的 script-fu 脚本有多复杂,也不知道它们转换为 ImageMagick 的(确实复杂)语法有多容易,但你绝对不会遇到启动时间长的问题。

Not so much a solution as a different possibility for the future, but have you considered not using GIMP?

GIMP is first and foremost a GUI-based app. If you're doing a lot of repetitive image manipulation from the command line, you might be better off with a tool like ImageMagick that's designed expressly for such use. I don't know how complex your script-fu scripts are, or how easily they could be translated to ImageMagick's (admittedly complex) syntax, but you definitely wouldn't have problems with long startup time.

时光与爱终年不遇 2025-01-10 16:36:31

您可以使用“Script-fu Server”。

图像窗口>主菜单>过滤器>脚本-fu>启动服务器。

您将看到一个弹出窗口,询问运行它的端口。同一弹出窗口上还提供了“帮助”,其中还描述了服务器使用的协议。

You could use "Script-fu Server" .

image window > Main menu > filters > script-fu > Start server.

You will be provided with a popup asking for the port to run it in. There is also "help" provided on the same popup, which also describes the protocol used by the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文