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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,967
» Latest member: Mike101
» Forum threads: 7,717
» Forum posts: 41,965

Full Statistics

Latest Threads
Can the gradient tool be ...
Forum: General questions
Last Post: CmykStudent
5 hours ago
» Replies: 6
» Views: 293
Pasting a layer group wit...
Forum: General questions
Last Post: Scallact
6 hours ago
» Replies: 1
» Views: 78
plugin-py3-export-all
Forum: Extending the GIMP
Last Post: CowboyJoe
8 hours ago
» Replies: 5
» Views: 241
Gimp 2.10.30 Text alignme...
Forum: General questions
Last Post: sallyanne
Yesterday, 11:13 AM
» Replies: 1
» Views: 157
Gimp 3 path tool auto con...
Forum: General questions
Last Post: CmykStudent
11-26-2025, 02:01 AM
» Replies: 9
» Views: 691
Numerous issues with 3.0+...
Forum: General questions
Last Post: rich2005
11-24-2025, 09:51 PM
» Replies: 2
» Views: 233
How to transform a layer ...
Forum: General questions
Last Post: stacash
11-24-2025, 08:47 PM
» Replies: 10
» Views: 805
How to make contours in G...
Forum: General questions
Last Post: denzjos
11-23-2025, 07:10 PM
» Replies: 2
» Views: 261
Has anyone tried getting ...
Forum: Extending the GIMP
Last Post: vitforlinux
11-22-2025, 04:32 PM
» Replies: 2
» Views: 339
What exactly tutorials ar...
Forum: General questions
Last Post: sallyanne
11-22-2025, 06:44 AM
» Replies: 6
» Views: 704

 
  Basic Tutorial Example
Posted by: elindarie - 10-05-2025, 01:02 AM - Forum: Extending the GIMP - Replies (3)

I don't know if this will help any other beginners on Gimp 3 Python scripting.

Taking most of a day, I made a simple example that works, to my amazement.  I have Gimp 3.0.4 on Ubuntu 22.04, and this runs in GIMP from Filters -> Development -> Python-Fu -> Python Console.

It draws a red box on a blue background.

Code:
import gi
gi.require_version('Gimp', '3.0')
from gi.repository import Gimp

Gimp.context_set_foreground(Gegl.Color.new("red"))
Gimp.context_set_background(Gegl.Color.new("blue"))
image = Gimp.Image.new(300, 400, Gimp.ImageBaseType.RGB)
layer = Gimp.Layer.new(image, "layer 1", 300, 400, Gimp.ImageType.RGBA_IMAGE, 100, Gimp.LayerMode.NORMAL)
image.insert_layer(layer, None, 0)
layer.edit_fill(Gimp.FillType.BACKGROUND)
Gimp.Display.new(image)
Gimp.Image.select_rectangle(image, Gimp.ChannelOps.REPLACE, 60.0, 80.0, 100.0, 150.0)
layer.edit_fill(Gimp.FillType.FOREGROUND)
Gimp.Selection.none(image)
Gimp.displays_flush()

I learned that you can also set colors in this format:

Code:
Gimp.context_set_foreground(Gegl.Color.new("#B00000"))

I found the documentation terribly sparse.  For example, in https://developer.gimp.org/api/3.0/libgimp,

at https://developer.gimp.org/api/3.0/libgi...angle.html, which contains:

Code:
gboolean
gimp_image_select_rectangle (
  GimpImage* image,
  GimpChannelOps operation,
  gdouble x,
  gdouble y,
  gdouble width,
  gdouble height
)

My script has the line: 

Code:
Gimp.Image.select_rectangle(image, Gimp.ChannelOps.REPLACE, 60.0, 80.0, 100.0, 150.0)

How I got from "gimp_image_select_rectangle" to "Gimp.Image.select_rectangle" wasn't clear, and when I looked up the constants for Gimp.ChannelOps.REPLACE,

at https://developer.gimp.org/api/3.0/libgi...elOps.html

it shows GIMP_CHANNEL_OP_REPLACE

from which it wasn't clear to me that this could be Gimp.ChannelOps.REPLACE.

I would be happy to help improve the documentation, which I found sparse and confusing.

I would be grateful if anyone could tell me how to change the dark blue font in the GIMP python console (without changing the Dark Colors scheme), because I couldn't read it at all unless I highlighted it so it showed as reverse video. I couldn't figure out where, maybe in what css file, this is defined.  I'm using gnome and X11.

To do this, it was a lot of hit and miss, and searching for other people's scripts and trying to find similar code in theirs.  Also, I don't really understand how to convert from pdb to non-pdb function calls and back.

I guess my next step is to convert this to a plug-in (.py) file.

Print this item

  "Newbie" here....
Posted by: Billy G. - 10-04-2025, 05:38 PM - Forum: Watercooler - Replies (1)

Well, not new to GIMP, but new here....jus' thought I'd chime in....

Print this item

  Gimp x Photoshop
Posted by: Dunham - 10-03-2025, 10:10 PM - Forum: Watercooler - Replies (5)

Good evening

I'm very new to the forum. I used to use Photoshop, and about two months ago I decided to leave Windows and migrate to Linux, and consequently to GIMP. I use GIMP 3.0.4 and I've really enjoyed it, and I've been learning by watching several videos on YouTube. While I'm at it, I'd like to know from more experienced people if GIMP can truly replace Photoshop without any problems. That is, excluding generative AI, does GIMP have the same or most of the features as Photoshop? Is the quality of the artwork on par with Photoshop's?

Print this item

  It´s possible to clone while scaling at same time?
Posted by: mrkid - 10-02-2025, 09:01 PM - Forum: General questions - Replies (8)

I mean, if you can make that the clone tool scale the source in realtime while cloning.

Print this item

  Gimp 3.0.4 doesn't have the old fonts
Posted by: GMP - 10-02-2025, 03:32 PM - Forum: General questions - Replies (10)

Gimp 3.0.4 doesn't have the old fonts from a project I did 3 years ago. I want to use the same font DejaVu Sans oblique on my new project. After not being ab;e to use the old font in my new project,  I loaded the old project and with the Text tool I selected the text with the font. I then changed the font with the text window on the right. I even changed back to the correct font and it's showing the wrong font.

Here are the snips for the wrong font and the correct font

https://onedrive.live.com/?id=%2Fpersona...IMP&view=0

I see that I still have Gimp 2.10 and I opened the old project and it's not correct either. So somehow the Fonts path must not be accurate. It's affecting both versions

Print this item

  changed behavior CNTL-X and CNTL-V, moving sections
Posted by: Hupa - 10-02-2025, 08:13 AM - Forum: General questions - Replies (1)

Hi all, 
I discovered changed behavior since I use version 3. 
I am maintaining scores for our choir and for that I sometimes need to amend, fix scores. Sometimes that involves changing, or better, moving texts on the score. 
For that I loaded the "original" in GIMP, select the portion that needs to move, cut (CTRL-X) it and that paste it (CTRL-V), after which I could move the paste portion around using my arrow keys. One of the use cases is also removing excessive white space.
In version 3 I can do the same CTRL-X and CTRL-V, but then nothing happens when I use the arrow keys. It appears like it has lost the connection to the selected area in the canvas.

I suppose something has changed in the behavior in version 3. I looked up for changes, and see entries on Internet about CTRL-C and CTRL-V, but they do not seem applicable to my use case. 

Thanks in advance

Print this item

  Bump Mapping Brick Wall
Posted by: trumpet - 10-01-2025, 10:14 PM - Forum: General questions - Replies (8)

I'm using w11 with gimp 3.04. While I'm creating still images with gimp, the images will ultimately be used in video.

Perhaps you've seen a brick wall at a library or train station that features images in relief constructed onto the wall, such as shown in the attached photo. That is the effect I'm trying to achieve. I have an .jpg/.bmp of the side of the building (called "wall) I'm trying to modify with several b&w images to be bumpmapped (called "bumpedimage") into/onto its side. The bumpedimages are .png.[img]E://Alliance-Files-Kenny Lincoln\WallDisplay\walldisplay6.jpg[/img]

1. To get the placement and size of the b&w bumpedimages correct, I have first made the wall and bumpedimgages the same size (pixelwize) with the bumpedimages occupying an area that is largely transparent. The bumpedimage is proportionally correct and placed in a predetermined x/y location. This placement is shown in the following attachment with the b&w layer on top. In the final application, which is video, the entire scene is zoomed into so that the bumpedimages coming out of the brick wall are more easily seen.

Please note that in this screencapture, the placement of the layers is incorrect as the bumpedimage layer is to be placed under the background image.[Image: c:\\Users\Admin\Pictures\Screenshots\wallgimp-1.png]

2. Even when I place the bumpedimage layer under the background layer and add the bump map filter to the background image (as shown in the attached file, I cannot get the desired effect no matter how extremely I vary the controls such as depth/elevation etc. [img]c://Users\Admin\Pictures\Screenshots\wallgimp-2.png[/img]

3. In the video, the background wall remains constant and does not move while different b&w images fade in and out (bump in and out) of the wall representing different historical figures attached to that location. Bumpedimages are of different sizes and located at different positions along the wall.

Any suggestions to make this effect work would be appreciated. Should the b&w images themselves be individually bumpmapped first, just to emphasize their contrast in shading or luminance?

Print this item

  Threshold Alpha totally doesn't work in 2.10 but works fine in 2.08
Posted by: jupiter - 10-01-2025, 08:33 PM - Forum: General questions - Replies (3)

I just spent a whole day trying a dozen different methods that are supposed to make all the transparent *colored* pixels in an image completely opaque while keeping the completely transparent pixels as they are. However in 2.10 whenever I set Threshold Alpha to zero as often suggested it has no effect and GIMP simply resets it to 0.5. Then I tried this in 2.08 and it worked fine right away.

Does that mean it's just plain broken in 2.10? Or is there an obscure deeply buried setting that somehow got changed in 2.10 that I'm not aware of and is blocking changes to the threshold? The Alpha channel is definitely not locked.

Print this item

  Duotone in GIMP
Posted by: kmll - 10-01-2025, 04:58 PM - Forum: General questions - Replies (4)

Hi
I have been using a duotone effect in Photofiltre on a student project. However that software is now too old to be installed and I am considering GIMP. Do anyone know if a duotone effect similar to the attachment is possible in GIMP, and if yes how?

As you can see the effect makes the image duotone and at the same time make the quality "reduced", more grainy.

Please see Link to image

(https://ibb.co/jk2ysW3G)

Print this item

  Learning GIMP after 30 years with Photoshop
Posted by: Rosseliani - 10-01-2025, 04:34 PM - Forum: General questions - Replies (4)

Hello everybody,
I recently decided to cancel my expensive Adobe Photoshop account.
Now I am learning to use the GIMP and I often encounter difficulties.
I already found that some Gimp features are better than Photoshop features.

My question is: Is there on the Gimp-Forum.net a thread about migratong from expensive Photoshop to free GIMP?

Thanks for answers!

Print this item