gimp

Writing a GIMP python script

我们两清 提交于 2019-12-03 06:10:02
问题 What I want to do is to open gimp from a python program (with subprocess.Popen, perhaps), and in the same time, gimp will start with a python script that will open an image and add a layer... Well, how can I achieve that(I wish GIMP had better documentation...)? Update: I did this: subprocess.Popen(["gimp", "--batch-interpreter" , "python-fu-eval" , "-b" ,"\'import sys; sys.path.append(\"/home/antoni4040\"); import gimpp; from gimpfu import *; gimpp.main()\'"]) ,but, even if the console says

How to convert XCF to PNG using GIMP from the command-line?

末鹿安然 提交于 2019-12-03 05:36:22
问题 As part of my build process I need to convert a number of XCF (GIMP's native format) images into PNG format. I'm sure this should be possible using GIMP's batch mode, but I have forgotten all of the script-fu I used to know. My input images have multiple layers, so I need the batch mode equivalent of "merge visible layers" followed by "save as PNG". Also note that I can't install anything in ~/.gimp*/scripts/ — I need a self-contained command-line, or a way to install scripts in my source

Resize layer to fit canvas - Gimp

依然范特西╮ 提交于 2019-12-03 05:06:37
问题 I'm currently using Gimp to resize some images. I'm a web developer but I don't really use image manipulation software much as most of the images are provided by designers so the Gimp tool is very unfamiliar to me. I've looked through all of the tutorials and help guides on the Gimp site but I cannot find the answer to the simplest of questions: How do you resize a layer to fit within the current canvas whilst maintaining the aspect ratio? I'm essentially setting a fixed size on my Canvas and

Converting XCF and other files using command line with GIMP?

我们两清 提交于 2019-12-03 02:49:44
If I have an XCF file (or any other supported by Gimp) how can I convert it to, for example, PNG for display or further processing? I'm a couple of years late, but I thought I'd add what I think is by far the best solution: there is a tool suite called Xcftools (on Ubuntu, apt-get install xcftools ), which has a utility called xcf2png that does this job perfectly. xcf2png image.xcf -o image.png This is much better than a) using ImageMagick (which as I said in a comment above is horribly broken), or b) using Gimp (which has an extremely complicated scripting language for simply exporting an

How to run python scripts using gimpfu from windows command line?

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use functions of gimp 2.8.22 to convert a pdf to jpeg and i want to do that with a python script using the gimpfu library from my windows cmd (i have installed python 3.6.1). Right now, i't trying to do that with an example script: #!/usr/bin/env python # Hello World in GIMP Python from gimpfu import * def hello_world(initstr, font, size, color) : # First do a quick sanity check on the font if font == 'Comic Sans MS' : initstr = "Comic Sans? Are you sure?" # Make a new image. Size 10x10 for now -- we'll resize later. img = gimp

GIMP教程 5 选择

匿名 (未验证) 提交于 2019-12-03 00:32:02
选择的意义在于限制作用范围,即,使所有操作只对选择部分有效, 不会“误伤”未选择部分。 gimp提供了多种选择工具,参见工具箱前几个按钮, 或者 【工具----选择工具】中按钮列表。 使用左键拖出选择范围,按住ctrl(shift、alt)可减少(增加、移动)选区, 最后按下 回车 键确认选择。 最后按下回车这一步很重要,如果没有按回车, 使用软件的过程会很令人抓狂的...... 想要取消选择,按下 ctrl+shift+A 就可以了。 还有问题可联系作者(QQ 616057653 )进行交流。 文章来源: GIMP教程 5 选择

Writing gimp plugins in python on windows- how do i debug? where is the output?

萝らか妹 提交于 2019-12-02 20:33:39
EDITED HEAVILY with some new information (and a bounty) I am trying to create a plug in in python for gimp. (on windows) this page http://gimpbook.com/scripting/notes.html suggests running it from the shell, or looking at ~/.xsession-errors neither work. I am able to run it from the cmd shell, as gimp-2.8.exe -c --verbose ## (as suggested by http://gimpchat.com/viewtopic.php?f=9&t=751 ) this causes the output from "pdb.gimp_message(...)" to go to a terminal. BUT !!! this only works when everything is running as expected , i get no output on crashes. i've tried print statements, they go nowhere

Resize layer to fit canvas - Gimp

白昼怎懂夜的黑 提交于 2019-12-02 18:19:31
I'm currently using Gimp to resize some images. I'm a web developer but I don't really use image manipulation software much as most of the images are provided by designers so the Gimp tool is very unfamiliar to me. I've looked through all of the tutorials and help guides on the Gimp site but I cannot find the answer to the simplest of questions: How do you resize a layer to fit within the current canvas whilst maintaining the aspect ratio? I'm essentially setting a fixed size on my Canvas and importing an image as a layer into my project. What I then wish to do is scale this much larger image

GIMP: Create image stack from all image files in folder

随声附和 提交于 2019-12-02 04:42:37
问题 I need to compare the results of segmentation algorithms where lots of images need to be stacked - e.g. original and binary image. So I thought of a GIMP script which takes the name of a directory and puts all containing image files into layers so that they can be switched on and off in GIMP to compare results. How to achieve this with GIMP? Thank you for your tips! Regards 回答1: "Not with script-fu". But Python is suitable to your needs. It is a simple script - the core logic should be 4

GIMP: Create image stack from all image files in folder

戏子无情 提交于 2019-12-02 00:41:45
I need to compare the results of segmentation algorithms where lots of images need to be stacked - e.g. original and binary image. So I thought of a GIMP script which takes the name of a directory and puts all containing image files into layers so that they can be switched on and off in GIMP to compare results. How to achieve this with GIMP? Thank you for your tips! Regards "Not with script-fu". But Python is suitable to your needs. It is a simple script - the core logic should be 4 lines or so, therefore I will just write it here for you: #!/usr/bin/python # -*- coding: utf-8 -*- from gimpfu