Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,923
» Latest member: JaimiriLyday
» Forum threads: 7,687
» Forum posts: 41,815

Full Statistics

Latest Threads
Colorized Layer Reverts t...
Forum: General questions
Last Post: rich2005
42 minutes ago
» Replies: 3
» Views: 122
How to make image and mas...
Forum: Installation and usage
Last Post: ESH
Yesterday, 08:11 PM
» Replies: 4
» Views: 188
Multi window mode mode fa...
Forum: General questions
Last Post: teapot
Yesterday, 01:40 PM
» Replies: 5
» Views: 316
Animation with only GIMP ...
Forum: Gallery
Last Post: Scut-51
11-06-2025, 11:49 AM
» Replies: 25
» Views: 22,977
GIMP 3.04 opens with wind...
Forum: Windows
Last Post: subbareddy
11-05-2025, 07:47 AM
» Replies: 7
» Views: 3,783
Isolate, select and copy/...
Forum: General questions
Last Post: rich2005
11-04-2025, 04:39 PM
» Replies: 7
» Views: 505
"Plug-in crashed" on GIMP...
Forum: General questions
Last Post: skullamrotis
11-04-2025, 03:32 PM
» Replies: 4
» Views: 456
AIMAGoR - Artificial IMAg...
Forum: Other graphics software
Last Post: vitforlinux
11-04-2025, 12:09 PM
» Replies: 23
» Views: 9,945
RapidRAW
Forum: Other graphics software
Last Post: denzjos
11-03-2025, 12:51 PM
» Replies: 2
» Views: 278
Tutoriel installer Drea...
Forum: Tutorials and tips
Last Post: meric57
11-03-2025, 07:45 AM
» Replies: 0
» Views: 138

 
  Python Scripting Help Needed Gimp 3
Posted by: silenuznowan - 03-29-2025, 05:37 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (1)

I have some simple batch scripts for version 2 that I am trying to convert to work with version 3, which I really like working with.

Anyway one simple script was this:

Code:
import os
import gimpfu

def convert(filename):
    img = pdb.gimp_file_load(filename, filename)
    new_name = filename.rsplit(".",1)[0] + ".png"
    layer = pdb.gimp_image_merge_visible_layers(img, 1)
    pdb.gimp_file_save(img, layer, new_name, new_name)
    pdb.gimp_image_delete(img)
    savepath = ('${DEST}' + '/' + "$1" )
    if os.path.exists(savepath):
        print('the folder exists')
    else:
        os.makedirs(savepath)
    os.rename(new_name, savepath + "/" + new_name)

from glob import glob
for filename in glob("*.xcf"):
    print(filename)
    convert(filename)

pdb.gimp_quit(1)

I'm now trying to do the equivalent with Gimp 3 but am unable to even load the file.

In Gimp 2 you could load a file with the one line:

Code:
img = pdb.gimp_file_load(filename, filename)

So now this is replaced with:

Code:
def load_file(filename):
    procedure = Gimp.get_pdb().lookup_procedure('gimp-file-load');
    config = procedure.create_config();
    config.set_property('run-mode', Gimp.RunMode.NONINTERACTIVE);    
    config.set_property('file', filename);
    result = procedure.run(config);
    success = result.index(0);
    image = result.index(1)
    return image;

def convert(filename):
    img = load_file(filename)


Only this results in the following error

Quote:TypeError: could not convert 'interior-starship-doors.xcf' to type 'GFile' when setting property 'GimpProcedureConfig-gimp-file-load.file'

So it looks like instead of expecting a filename for file the new python api expects an object of type GFile to be passed, and I was wondering how I do this?


Thanks in advance.

Update: I managed to figure things out using Gio so my new load_file function looks like this:


Code:
def load_file(filename):
    file = Gio.File.new_for_path(filename)
    procedure = Gimp.get_pdb().lookup_procedure('gimp-file-load');
    config = procedure.create_config();
    config.set_property('run-mode', Gimp.RunMode.NONINTERACTIVE);
    config.set_property('file', file);
    result = procedure.run(config);
    success = result.index(0);
    image = result.index(1)
    return image;

While this works, I'm wondering if I'm also supposed to dispose of the Gio.File object, and if so how do I do that?

Thanks in advance.  Also if there's any interest I can post the whole version of the new script.

Print this item

  ofn3-export-layers
Posted by: Ofnuts - 03-29-2025, 04:40 PM - Forum: Extending the GIMP - Replies (17)

This is ofn-export-layers ported to Gimp v3.

So far this is done without added functionality, for instance it will still export everything and not just the selected layers.

Any good ideas for enhancements welcome.

At the usual place for V3 things.

Enjoy.

Print this item

  Error while parsing
Posted by: rdoty - 03-29-2025, 04:38 PM - Forum: General questions - Replies (1)

When I load Gimp 3.0 I get this message "Error while parsing 'C:\Users\xxxx\AppData\Roaming\GIMP\3.0\devicerc' in line 9: invalid value 'a' for token select-criterion

Is this a problem and how do I correct?  Also, could this relate to some of the problems I had with a previous thread, difficulty removing jpeg background?

Print this item

  GIMP 3.0 View and Color menu length
Posted by: KenS. - 03-29-2025, 01:40 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (1)

Hi there, if I click on a menu, and then move either left of right, the menus dropdown so you can see the listings, but both the the View and Color menus are long, so they will not close when you move the cursor either left or right, with the View menu, you can click on the up arrow at the top, to clear the menu, but the Color menu doesn't have a arrow at the top that I can see, I have to move the cursor off to one side and click to clear the menu. Would like to see both menus extend downward, so the menu title isn't hidden. Take care.

Print this item

  Plugins
Posted by: sparky 1987 - 03-29-2025, 04:13 AM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (3)

   

I have Gimp 2.10.38 and now updated to 3.0.1  and just to 3.0.2 but have found cant get the plugins I have in previous verion to install in 3.
See pic where I copied the exact plugins from location for 2.10 but 3.0.2 and 3.0.1 does not seem to see them do you have to load some
other way in the new updates?

Print this item

  Gimp does not recognize Darktable or RawTherapee
Posted by: KnowNothing - 03-28-2025, 08:39 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (2)

I am running a laptop with Ubuntu and when Gimp updated it quit working with Darktable.  I have subsequently uninstalled all three programs and reinstalled them in various orders and Gimp will not open Raw files and does not show either Darktable or RawTherapee as import options.  Also does not appear to allow a person to enter either program as an import option.  I am not a programmer (I can barely take pictures), and virtually every web search just says  install the programs and they will work together.  NOT TRUE.  Most of those searches don't even relate to the new version of Gimp.  What is most perplexing is that My previous setup was working perfectly and the update to Gimp 3 was automatic but dropped any functionality with Darktable.

Print this item

  Overwrite function defaults
Posted by: andytua - 03-28-2025, 04:08 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (1)

Hello.  On my previous PC, i was on GIMP 2.10
using File---Overwrite would pop up a dialog box with Export Image as JPEG settings
Convenient way to change quality of original image

With Gimp 3.0, using Overwrite simply overwrites the file and offers no dialog box

I have tried everything I can think of to get the dialog box to pop up but i got nothing

Maybe there is a better alternative I am unaware of

thank you!!

Print this item

  Gimp 3 plugin sprites/objects/islands to layers, handy for spritesheets!
Posted by: joeyeroq - 03-28-2025, 12:26 PM - Forum: Extending the GIMP - No Replies

There are other plugins that do the same like Ofnuts "ofn-extract-objects" and G'MIC-Qt "Extract Objects" (install "G'MIC-Qt plugin", Plugin > Filters > G'MIC-Qt... > Arrays and Tyles > Extract Objects), but I wanted to learn some GIMP 3 Python scripting so made this.
How to install in Windows (I don't have Linux or Mac):
Go to GIMP 3 plugins folder by typing in the File Explorer's address bar:

Code:
%appdata%\GIMP\3.0\plug-ins
and extract plug-in-joey-py3-sprites-to-layers.zip file in there, the script path should look something like this:
C:\Users\<USER_NAME>\AppData\Roaming\GIMP\3.0\plug-ins\plug-in-joey-py3-sprites-to-layers\plug-in-joey-py3-sprites-to-layers.py
Usage:
Open GIMP 3, open an image, select the layer you want your sprites/objects/islands extracted from, than Layer > Sprites to layers.

.zip   plug-in-joey-py3-sprites-to-layers.zip (Size: 3.29 KB / Downloads: 202)
   

Print this item

  Combine Save and Export
Posted by: theDrake - 03-28-2025, 09:43 AM - Forum: Watercooler - Replies (1)

I've been working on the graphics for a programming project and I'd like to make a suggestion for improving how GIMP handles the situation I find myself in.

Before I get into the issue I'd like to bring up, please know that I love GIMP. The way it handles layers is far superior to any other graphics application I've ever used, including Photoshop which I've been using for over 20 years. I understand why the .xcf format is important; after all, it preserves so much history of the image and it sounds like it's going to get even better very soon.

However, there's a case for combining Save and Export for images. Export makes sense for PDFs or perhaps ASCII-based formats suitable for including in program data, but for images, it's far more convenient to just use Save.

Now, what I've been dealing with...

The images are all PNGs generated by Inkscape. Of necessity, I've had to fiddle with a few of them to make them fit the UI. The process of saving these images takes me through no less than five dialog windows before the image gets saved.

It would be a lot faster if I could simply hit Ctrl-S to save these files. Then the only extra dialog I'd have to deal with is the one that asks me if I want to replace the existing file. Currently, I have to do this:

  • Ctrl-S
  • select the .xcf extension,
  • delete it,
  • type ".png"
  • hit Enter,
  • answer the dialog that asks if I actually want to Export
  • click OK on the Export dialog,
  • answer the "Do you want to Replace" dialog,
  • click OK on the final "Do the thing" dialog.
Two dialogs or five.

I could just export and that might save me a few steps, but it'll still be more than two dialogs. Besides, coming from any other graphics applications (Photoshop, Krita, Tahoma, Corel Painshop Pro, MS Paint, etc.) I'm used to Ctrl-S, not Ctrl-E.

Oh! And it would also help to have a drop-down menu from which to select the file type. Saves typing.

 So, who do I talk to about this? Or is this post enough to get the attention of the developers?

Print this item

  How to connect layers ?
Posted by: henry_albrecht - 03-27-2025, 10:16 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (12)

Hi

In earlier Versions one could connect layers. This function is no longer available ?

The symbol in the layers-overview for chaining the layers is gone.

I want to scale several layers in one action. But it doesnt work. I tried the intuitive way by selecting all of them and then choose the scale-dialog .. but just one layer is scaled then.

Print this item