| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 5,115
» Latest member: Betflag
» Forum threads: 7,804
» Forum posts: 42,399
Full Statistics
|
| Latest Threads |
Cannot open camera raw im...
Forum: Windows
Last Post: Zbyma72age
1 hour ago
» Replies: 5
» Views: 232
|
How to rotate selection
Forum: General questions
Last Post: depmco
Yesterday, 08:15 PM
» Replies: 3
» Views: 199
|
How to make a mask from a...
Forum: Extending the GIMP
Last Post: Scallact
Yesterday, 07:45 PM
» Replies: 10
» Views: 414
|
freeze on export
Forum: Gimp 2.99 & Gimp 3.0
Last Post: alpheratz
Yesterday, 09:52 AM
» Replies: 3
» Views: 3,228
|
how to use different font...
Forum: General questions
Last Post: sallyanne
Yesterday, 12:35 AM
» Replies: 9
» Views: 564
|
Gimp 3.x scanner xsane pl...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: mrseudo
02-09-2026, 10:54 PM
» Replies: 16
» Views: 16,750
|
nikgimp - a NikCollection...
Forum: Extending the GIMP
Last Post: ersc57
02-07-2026, 08:41 AM
» Replies: 4
» Views: 3,904
|
Ofnuts
Forum: General questions
Last Post: sallyanne
02-07-2026, 05:29 AM
» Replies: 0
» Views: 150
|
arakne path shapes
Forum: Extending the GIMP
Last Post: sallyanne
02-07-2026, 05:18 AM
» Replies: 7
» Views: 553
|
How to apply layer to obj...
Forum: General questions
Last Post: rich2005
02-05-2026, 03:59 PM
» Replies: 1
» Views: 234
|
|
|
| Basic Python-Fu usage |
|
Posted by: BenjyvC - 11-06-2024, 05:57 PM - Forum: Scripting questions
- Replies (4)
|
 |
I queried Bing's Co-Pilot what tool and what code might serve to automate splitting an image into squares, this to conform to the format requirement of a cloud-based machine vision tool called Roboflow, which I'm intending to use to automate crack detection in concrete. (I've managed to learn enough about labelling in CVAT to download a json file containing the annotations in COCO 1.0, but am stuck attempting to train a model locally on my PC using detectron2.) To stay in motion while I await help on that, here's where I'm stuck using a Python-Fu script in Gimp.
When the code from Co-Pilot didn't produce anything, I asked it to simplify the operation to first confirm basic functionality using scripting in Gimp. It suggested creating a new file, but when that didn't produce anything, it further simplified to create a simple message, "Hello from Python-Fu". And when that only flashed the Console for a fraction of a sec, it included a prompt to pause for 10 seconds, which then at least that pause did work. That said, I'm not even seeing the pause when adding the create new image prompt:
from gimpfu import *
import time
def simple_message(image, drawable):
gimp.message("Hello from Python-Fu!")
time.sleep(10) # Pause for 10 seconds
def create_image(image, drawable):
save_dir = "D:/ALDOT_Model/Split_Test" # Change this to your desired directory
os.makedirs(save_dir, exist_ok=True)
# Create a new image
new_image = pdb.gimp_image_new(100, 100, RGB)
new_layer = pdb.gimp_layer_new(new_image, 100, 100, RGB_IMAGE, "New Layer", 100, NORMAL_MODE)
pdb.gimp_image_insert_layer(new_image, new_layer, None, -1)
pdb.gimp_image_flatten(new_image)
pdb.file_png_save(new_image, pdb.gimp_image_get_active_drawable(new_image), os.path.join(save_dir, "new_image.png"), "new_image.png", False, 9, True, True, True, True, True)
gimp.message("Created and saved a new image as new_image.png")
register(
"python_fu_create_image",
"Create a new image and save it",
"Create a new image and save it",
"Your Name",
"Your Name",
"2024",
"<Image>/Python-Fu/Create Image",
"*",
[],
[],
create_image)
main()
Many thanks for your insights!
|
|
|
| How to edit DDS file? |
|
Posted by: GimpForMe - 11-06-2024, 09:42 AM - Forum: General questions
- Replies (4)
|
 |
With the instructions found here, I am able to open DDS files (BC7 texture files from game Skyrim SE) and export them. But I haven't found out how to edit them the way I would like to.
The goal for the linked texture file (https://we.tl/t-xuztkOnwWM) is to make the dirt less visible/less pronounced/less dark. But I haven't found out what exactly to edit on the alpha and/or RGB channels.
Maybe anyone can help?
|
|
|
| Another plea for help - "open with" |
|
Posted by: david - 11-05-2024, 03:00 PM - Forum: Linux and other Unixen
- Replies (2)
|
 |
Ubuntu 20.04 with Unity desktop
Gimp 2.10.38 (PandaJim with Python 2.7)
Since yesterday I have lost the "Open with GNU Image Manipulation Program" for jpg, png and gif files when I am in the files menu. (tif files open normally.)
However, if I click on a thumbnail for these file types on the Unity desktop I get the option to open with Gimp.
In the gimp.desktop file there are: image/jpeg; image/png; and image/gif;
In ~/.config/mimeapps.list I can see image/jpg=gimp.desktop; image/png=gimp.desktop; and image/gif=gimp.desktop;
In addition there are numerous entries of the form: image/jpeg=GIMP-2.10.21.desktop which I suspect are obsolete as there is no GIMP-2.10.21.desktop file, only a
gimp.desktop
The only changes I have made are to fit a second monitor and to install XnView MP.
I have spent many hours searching the internet without finding a clue as to what may be the problem!
Any help most gratefully received!
David.
|
|
|
| Picture issue |
|
Posted by: Jeanstnle - 11-03-2024, 04:21 PM - Forum: General questions
- Replies (2)
|
 |
Hello,
First of all, I'd like to say that I am french, and I apologize for my poor english.
Actually I got an issue with Gimp, when inserting a picture in my document.
When I open the picture as a new document, it seems quite ok, reasonable size (10 x 10 cm), and the image is clear.
But when I try to insert the picture (open as layer) in my Gimp document, the picture included is very big (120 x 120 cm) and using the scaling tool to reduce the size, will badly damage the image quality ...
What is my mistake ???
Thank you for your advices, with my best regards,
Jean
|
|
|
|