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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,983
» Latest member: sawzie
» Forum threads: 7,395
» Forum posts: 40,283

Full Statistics

Latest Threads
crop and straighten photo...
Forum: General questions
Last Post: denzjos
Yesterday, 10:51 AM
» Replies: 6
» Views: 152
Color fill into pasted la...
Forum: General questions
Last Post: sallyanne
Yesterday, 06:39 AM
» Replies: 1
» Views: 110
Arrow Script
Forum: Extending the GIMP
Last Post: Chris Thompson
05-08-2025, 07:48 PM
» Replies: 133
» Views: 168,902
ofn3-layer-tiles
Forum: Extending the GIMP
Last Post: karaxus
05-08-2025, 10:53 AM
» Replies: 7
» Views: 1,052
Slowing down
Forum: General questions
Last Post: rich2005
05-08-2025, 10:33 AM
» Replies: 2
» Views: 217
Script-Fu in GIMP 3 websi...
Forum: Extending the GIMP
Last Post: pixelmixer
05-08-2025, 10:22 AM
» Replies: 13
» Views: 1,315
AppImage for 2.10.38
Forum: Alternate Gimp packagings
Last Post: Tas_mania
05-07-2025, 11:10 PM
» Replies: 4
» Views: 316
I can' show the two layer...
Forum: General questions
Last Post: blogsofwardotme
05-07-2025, 09:10 PM
» Replies: 2
» Views: 166
Map to cylinder adding ra...
Forum: General questions
Last Post: n4mwd
05-07-2025, 06:46 PM
» Replies: 2
» Views: 152
Forced to operate Gimp 3....
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
05-07-2025, 03:22 PM
» Replies: 1
» Views: 120

 
  nikgimp - a NikCollection plugin for GIMP3
Posted by: iiey - 04-03-2025, 12:05 PM - Forum: Extending the GIMP - Replies (3)

There is another related thread Rewrite shellout.py to GIMP3, which is more Q&A/troubleshooting oriented.
For the sake of completeness, it might be worth briefly introducing the plugin here.

For any interest, details can be found here:
https://iiey.github.io/nikgimp

Print this item

  Converting the API doc to Python
Posted by: Ofnuts - 04-03-2025, 09:11 AM - Forum: Tutorials and tips - No Replies

A little bit of C.

In C you have two kinds of data types.

  • The "native" ones: int and floats of various lengths, and pointers (memory addresses)
  • The "complex" ones (anything else, "structs" or arrays)
When you call a function:
  • native types are passed "by value": their value is copied in the call stack
  • complex types are passed "by reference": a pointer to them is copied in the calls stack. The fact that this is a pointer is indicated by *
  • the function can only "return" a single native type
  • the function can also update memory locations to which a pointer has been passed, this is how extra return values can be used
In addition:
  • Except for constructors, in the C description the first argument of a class method is an object of the class
  • When used with Python object syntax, this first argument becomes the object on which the method is called (with of course, one less argument). 
  • So for instance the method described in the doc as do_something(SomeClass, arg1, arg2) is called in Python as instance_of_SomeClass.do_something(arg1,arg2)
For instance with this "C" prototype from the Gimp.Drawable description:
Code:
gboolean
gimp_drawable_get_offsets (
 GimpDrawable* drawable,
 gint* offset_x,
 gint* offset_y
)

Where GimpDrawable is a "complex" type, and gboolean and gint are "native" type (just  names for machine-size integers).

* the function returns a boolean
* the first argument is a pointer/reference to GimpDrawable. Since GimpDrawable is a complex type it is a simple "input" argument.
* as stated above, since this is a method on Gimp.Drawable in python it will be called on the object which is the first argument.
* offset_x and offset_y are references to native types, and so are outputs to the function. In Python your inputs are immutable, so this is converted to extra return values, and the method returns a tuple.

So this would be called as:

boolean_success, offset_x,offset_y= get_offsets(layer: Gimp.Drawable)

But since the first argument is of the type described, in Python this method call on a  Gimp.Drawable object, so it is passed implicitly when calling the method.

boolean_success, offset_x,offset_y= layer.get_offsets()

The returned boolean here is a bit artificial. This is probably because the method has to use output arguments to return X and Y, so this is the only way to check that the memory locations passed for the offsets have been updated. This can still be ignored in the vast majority of cases by writing:

_, offset_x,offset_y= layer.get_offsets()

where _ is the Python convention to indicate that you don't really care about this value.

Slightly harder:

Code:
GimpLayer*
gimp_image_get_layer_by_name (
 GimpImage* image,
 const gchar* name
)
  • The function takes a reference to a GimpImage, so in this case this is the implicit reference to the object on which the method is called.
  • The function takes a reference to gchar. This isn't an output for a single char, this is a reference to an array of characterss (arrays and pointer are equivalent in C, an array is defined by the address of its first element). And an array of gchar is... a string. What also indicates that this is an input-only argument is the const modifier.
  • The call returns a pointer to a GimpLayer, so in Python, a plain Gimp.Layer
     
So this defines a Gimp.Image method that would be type-hinted as:

def get_layer_by_name(name: str) -> Gimp.Layer

Raising the bar:

Code:
GimpLayer **
gimp_image_get_selected_layers (
 GimpImage* image
)

Here the call return a pointer to a pointer to GimpLayer... this is really a pointer to an array of GimpLayer, so for Python just a list of Gimp.Layer. So this is just:

def get_selected_layers() -> list[Gimp.Layer]

Gotcha:

Note that some calls are defined as functions and not as object methods. For instance:


Code:
gboolean
gimp_file_save (
 GimpRunMode run_mode,
 GimpImage* image,
 GFile* file,
 GimpExportOptions* options
)

This is a plain function in the Gimp namespace that takes 4 explicit arguments.

Print this item

  gimp don't let me dock color tab above tabs right side
Posted by: strongtower1 - 04-02-2025, 11:30 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (2)

Hi everyone , I'm using Gimp 3.0.2-1 ( converted to Photogimp) and happens that when the window shows up the software don't let me adjust the window vertically , so....I can't be able to see the options of the lower right side compared to photoshop I'm talking about the another layer, opacity tool, and others. I tried to edit the preferences of window but no results to adjust the window vertically to fit the screen and I can be able to see the lower tools and options. Any recommend will be highly appreciated, my profound thanks in advance.

Print this item

  How to work with effects in GIMP Python?
Posted by: joeyeroq - 04-02-2025, 09:32 PM - Forum: Scripting questions - Replies (4)

In GIMP 2 you could threshold the alpha channel (Layer > Transparency > Threshold Alpha...), in Python console equivalent was:

Code:
image = gimp.image_list()[0]
layer = image.layers[0]
# image,layer,threshold.
pdb.plug_in_threshold_alpha(image,layer,0)

In GIMP 3 Threshold Alpha has become a filter ("fx" icon next to the layer)
I can do in GIMP 3:

Code:
image = Gimp.get_images()[0]
layer = image.get_selected_layers()[0]
# Add Threshold Alpha layer fx (Layer > Transparency > Threshold Alpha...).
filter1 = Gimp.DrawableFilter.new(layer, 'gimp:threshold-alpha', 'My Threshold Alpha')
# Add Gaussian Blur layer fx (Filters > Blur > Gaussian Blur...).
filter2 = Gimp.DrawableFilter.new(layer, 'gegl:gaussian-blur', 'My Gaussian Blur')
layer.append_filter(filter1)
layer.append_filter(filter2)
But this does the filters in default settings.
How do I change the settings of the filters, for example how do i set the alpha value to 0 of 'My Threshold Alpha'?
   

Print this item

  GIMP 3.0 crashing
Posted by: rdoty - 04-02-2025, 08:42 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (2)

I keep getting the error message "Plug-in crashed: "file-svg.exe".   I've reloaded 3.0 but no change.  Do I need to delete current program and start over with a new download or is there some easy fix?  Thanks in advance.

Print this item

  0xc000007b error
Posted by: roberts - 04-02-2025, 03:32 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (3)

Hello,

I installed GIMP 3.02 on a Windows 11 ARM computer.
When launching GIMP, a twain.exe application error window displays "The application could not start correctly error 0xc000007b," then GIMP runs correctly.
Thank you for your help.

Roberts

Print this item

  Version 3 seems to have installation issues.
Posted by: brianleach - 04-02-2025, 11:46 AM - Forum: Windows - Replies (3)

Still on Windows 10 and have had no issues with previous GIMP versions.

However versions of 3 have an issue.

The installation appears to have no issues and on completion asks you if you wish to start the program. You say yes and the interface for version 3 opens with no problem. However (whether you pin it to the taskbar or not) on closing it cannot be opened again as it has been installed and defaults to the exe for the previous version.

Foolishly I thought if I uninstalled that version a new 3 would be set up but there appears to be no way to say where the new version would be located so it fails.

In the App Data there are separate folders for each version but I cannot find an exe file.

I have therefore had to reinstall an earlier version and the latest download I could find is 2.8.22 although I am sure I had perhaps 2.10. 

What am I doing wrong please.

Print this item

  I need an ISO of Gimp 2.1 Ubuntu Deb..
Posted by: KiddyComputers - 04-02-2025, 07:54 AM - Forum: Older Gimp versions (2.8, 2.6....) - Replies (2)

I'm running Linux Mint Mate 20.3 in a hundred notebooks for terminally ill kids in children's hospitals.. Often I must reinstall the OS in their computers because somehow a few of them kill the OS's.. But now when I configure the new Gimp in their notebooks, restart brings Gimp up not configured.. Seems I need an old version of Gimp for the kiddies computers running Linux Mint Mate 20.3.. I'd like to acquire a complete simple basic install ISO download of Gimp 2.1 so I can install it from a flash drive.. I just spent an hour bouncing around various older version Gimp websites downloading stuff here there and everywhere that doesn't work, in trying to find a suitable download ISO of the older Gimp that actually works in an Ubuntu-20.3 related OS, but I just can't find it.. Everything has been ultra modernized.. Can someone please tell me where I can find an old download of Gimp that actually works to install Gimp when you just click on the downloaded file...

---deleted inappropriate content for this forum---
---try and keep to Gimp graphics editing subjects only---

Does Gimp have an archives download website like how Linux Mint has this archive download website..?
https://thingsthemselves.com/linux-mint-archives/

Print this item

  Python Script Another Discrepency
Posted by: silenuznowan - 04-01-2025, 08:37 PM - Forum: Extending the GIMP - Replies (7)

I had a function in version 2 that inserted layers into a specific layer group.

I'm now trying to use the same procedure in Gimp 3 but have run into a type error.

First here's the doc:

Quote:This procedure adds the specified layer to the image at the given position. If the specified parent is a valid layer group (See 'gimp-item-is-group' and 'gimp-layer-group-new') then the layer is added inside the group. If the parent is 0, the layer is added inside the main stack, outside of any group. The position argument specifies the location of the layer inside the stack (or the group, if a valid parent was supplied), starting from the top (0) and increasing. If the position is specified as -1 and the parent is specified as 0, then the layer is inserted above the active layer, or inside the group if the active layer is a layer group. The layer type must be compatible with the image base type.


However if I pass a valid GroupLayer as the value of parent I get the following error:


Code:
TypeError: could not convert (<PDBStatusType.SUCCESS: 3>, <Gimp.GroupLayer object at 0x7f359387fa40 (GimpGroupLayer at 0x5596f842c040)>)
to type 'GimpLayer' when setting property 'GimpProcedureConfig-gimp-image-insert-layer.parent'

Is there another way to insert layers into a specific LayerGroup ?

Edit I was trying to further figure things out and I notice that passing a LayerGroup to the procedure gimp-item-is-group results in a similar typecast error:


Code:
TypeError: could not convert (<PDBStatusType.SUCCESS: 3>, <Gimp.GroupLayer object at 0x7f70a7ebb180 (GimpGroupLayer at 0x5561a26ba060)>)
to type 'GimpItem' when setting property 'GimpProcedureConfig-gimp-item-is-group.item'


Thanks.

This was human error on my part passed the wrong item.  Sorry.

Print this item

  Gimp 3.0 AI Plugins - Updated
Posted by: nchen - 04-01-2025, 04:45 PM - Forum: Extending the GIMP - Replies (2)

Hello everyone,

I have updated my AI plugins for GIMP 3. It's still a work in progress, but it's in a usable state. Feel free to reach out to ask questions or suggest improvements!
They also no longer require specific workflows or custom nodes, unless you intend to use LoRAs.
Currently I'm looking to update the previous auto selection feature to GIMP 3 as well as add AI upscaling options. These features are currently possible if you have an understanding of ComfyUI, but I intend to simplify the process and break them into their own plugins.

Video Demonstration
Github

Edit: Most of the dialog box options (ksampler, checkpoint, lora selection) and previews are optional. It should use the defaults within your selected workflow if values are not available.

Print this item