| Welcome, Guest |
You have to register before you can post on our site.
|
|
|
| How to transform a layer and a path both together? |
|
Posted by: teapot - 11-19-2025, 02:28 AM - Forum: General questions
- Replies (9)
|
 |
Hi,
In gimp 3 (currently 3.0.4) how do I transform a layer and a path both together with a transform tool such as move, rotate, scale etc.
In gimp 2 I can lock them both and then use a transform tool to transform both by the same transformation.
In gimp 3 I can have the path selected in the paths dialog and the layer selected in the layers dialog but as far as I can spot so far a transform tool will transform one or the other not both.
Thanks for any help.
|
|
|
| Gimp 3.0.6 Python plug-in bug with text layer.set_color(color)? |
|
Posted by: Volker - 11-18-2025, 02:43 PM - Forum: Scripting questions
- Replies (8)
|
 |
My environment: Apple Mac mini M2, macOS Tahoe 26.1.
I want to set the color of a text layer from a Python plug-in. In Gimp 2 I used the plug-in "gimp-text-layer-set-color".
In Gimp 3 I find the layer method "set_color(color)", but the color remains to be the foreground color. The same with the PDB plug-in.
First try with layer method:
Code:
textColor = Gegl.Color.new("red") # e.g.
textLayer = Gimp.TextLayer.new(image, "Text", someFont, sometextSize, Gimp.Unit.pixel())
textLayer.set_name("Text")
textLayer.set_color(textColor)
image.insert_layer(textLayer, parent, position)
The text is black.
Next try with pdb proc:
Code:
textColor = Gegl.Color.new("red") # e.g.
textLayer = Gimp.TextLayer.new(image, "Text", someFont, sometextSize, Gimp.Unit.pixel())
textLayer.set_name("Text")
pdb = Gimp.get_pdb()
textLayerSetColor = pdb.lookup_procedure("gimp-text-layer-set-color")
pdbConfig = textLayerSetColor.create_config()
pdbConfig.set_property("layer", textLayer)
pdbConfig.set_property("color", textColor)
textLayerSetColor.run(pdbConfig)
image.insert_layer(textLayer, parent, position)
The text is black.
Next try with foreground:
Code:
textColor = Gegl.Color.new("red") # e.g.
foreground = Gimp.context_get_foreground()
Gimp.context_set_foreground(textColor)
textLayer = Gimp.TextLayer.new(image, "Text", someFont, sometextSize, Gimp.Unit.pixel())
textLayer.set_name("Text")
image.insert_layer(textLayer, parent, position)
Gimp.context_set_foreground(foreground)
Success! The text is red.
Where is the error? With my code or with Gimp?
|
|
|
| Ubuntu - Right way to craft a .desktop entry for the AppImage |
|
Posted by: ExplodingCabbage - 11-18-2025, 02:08 PM - Forum: Linux and other Unixen
- Replies (2)
|
 |
Background: I've downloaded GIMP-3.0.6-x86_64.AppImage onto my Ubuntu 24.04.3 LTS box, then created a .local/share/applications/GIMP.desktop file with the following content...
[Desktop Entry]
Version=1.0
Name=GIMP
Exec=/home/mark/Applications/GIMP-3.0.6-x86_64.AppImage
Icon=/home/mark/.local/share/GIMP.png
Terminal=false
Type=Application
Categories=Graphics;
... and then pinned it to the left sidebar (the "dash") searching for it in the app launcher, right-clicking it, and clicking "Pin to Dash".
It... sort of works. I see the icon in my sidebar:
![[Image: BpAd6NW.jpeg]](https://i.imgur.com/BpAd6NW.jpeg)
And when I click on that icon, GIMP opens. But GNOME doesn't seem to understand that the newly opened window is associated with the GIMP program whose sidebar shortcut I just clicked on. Instead, it creates a new, temporary shortcut, with a generic gear icon, in the bottom section of the dash:
![[Image: SmVwbcQ.jpeg]](https://i.imgur.com/SmVwbcQ.jpeg)
This behaviour differs from other AppImage-based applications I've created .desktop files for. For instance, if I open multiple windows of Zed, I see three orange dots next to my Zed icon in my sidebar, and I can right-click on the sidebar icon and go to "All Windows" to see all the open Zed windows I have open:
![[Image: 8mD9TsS.jpeg]](https://i.imgur.com/8mD9TsS.jpeg)
How - if at all - can I likewise make my open GIMP window be represented by an orange dot next to my pinned GIMP shortcut, instead of by adding a new shortcut with a gear icon? Is the reason this doesn't work that I have done something wrong in crafting my .desktop file, or is GIMP missing some kind of feature that's needed for it to properly integrate with the GNOME dock in the way other programs do.
|
|
|
| Beginner question on Layer. Filer sequence |
|
Posted by: 5354photos - 11-18-2025, 03:39 AM - Forum: General questions
- Replies (2)
|
 |
I used GImp 3.0. So, there are Non Destructive Filters. I also use GMIC and layers. Somehow, I am confused the sequence of effects. My guess is
a/ The upper layer will take priority over the layer below
b/ Filters within the same layer also follow the same logic in a (Top is over bottom)
How should I use GMIC filters, eg I want to apply tone Enhance and then Freaky Details? In Input/Output, when to choose In Place/New Layer?
|
|
|
| Problem with Gimp 3 Python plug-in color_argument |
|
Posted by: Volker - 11-16-2025, 05:51 PM - Forum: Scripting questions
- Replies (7)
|
 |
I try to migrate my Python plug-in to decorate a jpeg photo with margin, border and description from Gimp 2 to Gimp 3.
it works as intended as long as I don't add a color-argument. What is wrong with this code?
Code:
import sys
import os
from glob import glob
import gi
gi.require_version('Gimp', '3.0')
from gi.repository import Gimp
gi.require_version('GimpUi', '3.0')
from gi.repository import GimpUi
from gi.repository import GObject
from gi.repository import GLib
#from gi.repository import Gtk
from gi.repository import Gio
from gi.repository import Gegl
...
class MarginBorder(Gimp.PlugIn):
def do_query_procedures(self):
return [plugInMBProc]
def do_create_procedure(self, name):
procedure = None
if name == plugInMBProc:
procedure = Gimp.ImageProcedure.new(self, name,
Gimp.PDBProcType.PLUGIN,
margin_border_run, None)
procedure.set_sensitivity_mask(Gimp.ProcedureSensitivityMask.DRAWABLE |
Gimp.ProcedureSensitivityMask.NO_DRAWABLES)
procedure.set_menu_label("Rand und Rahmen")
procedure.set_attribution("Volker", "Volker Lenhardt", "2025")
procedure.add_menu_path("<Image>/Volker")
procedure.set_documentation("Volkers Rand, Rahmen und Bildtext",
"Fügt dem aktiven Bild die Dekorationsebenen "\
+ "Rand, Rahmen und Bildtext hinzu.",
None)
procedure.add_font_argument("font", # name
"Font", # nick
None, # blurb
True, # none_ok
Gimp.Font.get_by_name(
"URW Gothic L Book"), # default_value
False, # default_to_context
GObject.ParamFlags.READWRITE) # flags
procedure.add_string_argument("desc", # name
"Bildbeschreibung", # nick
None, # blurb
"Irgendwo", # value
GObject.ParamFlags.READWRITE) # flags
procedure.add_double_argument("marginRelation", # name
"Randbreite in Promille der größten Bildausdehnung", # nick
None, # blurb
0.0, # min
30.0, # max
9.0, # value
GObject.ParamFlags.READWRITE) # flags
procedure.add_double_argument("borderRelation", # name
"Rahmenbreite in Promille der größten Bildausdehnung", # nick
None, # blurb
0.0, # min
10.0, # max
1.8, # value
GObject.ParamFlags.READWRITE) # flags
procedure.add_color_argument("borderColor", # name
"Rahmenfarbe", # nick
None, # blurb
False, # has_alpha
Gegl.Color.new("black"), # value
GObject.ParamFlags.READWRITE) # flags
return procedure
Gimp.main(MarginBorder.__gtype__, sys.argv)
If I omit the procedure.add_color_argument all is well, but with it the plug-in doesn't even show up in Gimp.
I can't find any code errors, or do you?
Thanks in advance for your help.
|
|
|
|