But GIMP is actually nice, you can do many complex UI operations from code and you also have an interactive Python shell to test your code live on an image.įor example, open an image in GIMP, then open the Python console from Filters -> Python-Fu -> Console and execute the following code: img = gimp.image_list()Īnd you’ll see that the image is now halfway transparent. Of course, I could’ve tried other solutions like PIL (Python Imaging Library) which I have used in the past. Just to mention, GIMP supports also a Lisp syntax to write scripts, but it caused my eyes to bleed profusely, so I didn’t even take into it consideration and focused directly on Python. So I thought, why not using a GIMP batch command, since anyway GIMP is installed on most Linux systems by default? One of the produced images had to be semi-transparent. ![]() ![]() ![]() To those wondering why GIMP, it’s because I created a new icon for Profiler and wanted to automatize some operations on it in order to have it in all sizes and flavors I need. You can jump to the end of the tutorial to find a nice skeleton batch script if you’re not interested in reading the theory. I spent a total of one hour researching this topic, so I’m not an expert and I could have made mistakes, but perhaps I can save some effort to others which want to achieve the same results. I won’t go into the details of the Python GIMP SDK, most of it can be figured out from the GIMP documentation. ![]() Not a very common topic for me, but I thought it could be neat to mention some tips & tricks.
0 Comments
Leave a Reply. |