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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,233
» Latest member: dplumes
» Forum threads: 6,584
» Forum posts: 35,869

Full Statistics

Latest Threads
Plugin for special black-...
Forum: General questions
Last Post: Ofnuts
8 hours ago
» Replies: 5
» Views: 81
It it just me?
Forum: Watercooler
Last Post: Ofnuts
8 hours ago
» Replies: 4
» Views: 77
ExifToolGUI and ExifTool ...
Forum: Other graphics software
Last Post: PixLab
Yesterday, 02:01 PM
» Replies: 4
» Views: 83
Time to Leave Ubuntu - do...
Forum: Alternate Gimp packagings
Last Post: Tas_mania
Yesterday, 04:28 AM
» Replies: 0
» Views: 87
Crash/Freeze on Large Ima...
Forum: General questions
Last Post: PixLab
Yesterday, 04:16 AM
» Replies: 7
» Views: 220
I Have A Custom Ubuntu 24...
Forum: Alternate Gimp packagings
Last Post: Tas_mania
Yesterday, 04:08 AM
» Replies: 1
» Views: 135
Plug-in folder
Forum: General questions
Last Post: Ofnuts
03-17-2024, 05:18 PM
» Replies: 1
» Views: 62
beer belly
Forum: General questions
Last Post: Ofnuts
03-17-2024, 05:16 PM
» Replies: 1
» Views: 70
Background removal
Forum: General questions
Last Post: rich2005
03-16-2024, 10:00 AM
» Replies: 5
» Views: 160
Paste images using coordi...
Forum: General questions
Last Post: rinaldop
03-15-2024, 09:52 PM
» Replies: 6
» Views: 210

 
  drawable
Posted by: gimpygirl - 03-02-2024, 11:10 PM - Forum: Scripting questions - Replies (1)

What can a drawable be. A layer, what else?
Any docs page where I can read?

There is this

https://developer.gimp.org/api/2.0/libgi...mpDrawable

but it doesn't tell me all possible things that can be a drawable.
I don't understand it completely  Blush

Print this item

  Help with color change
Posted by: rinaldop - 03-01-2024, 11:44 PM - Forum: General questions - Replies (3)

Hello everyone,

I am back with what I hope is a simple question. I would like to turn the red pill shaped areas in the image below from red to black two at a time all the way down. Thank you for any tips!

   

   

   

Print this item

Python Python Plug-in that Changes SubLayers Visibility and Export Images as PNG Files
Posted by: TiredGuy - 03-01-2024, 10:24 PM - Forum: Scripting questions - Replies (2)

Hello everybody!
I’m not very good not in GIMP, nor in Python, nor English, so please excuse me for my mistakes)

I have a .xcf file with a lot of layers and sublayers, for example:

(visible)        Layer_1
(visible)            Sublayer_1.1
(invisible)          Sublayer_1.2
(visible)        Layer_2
(invisible)        Sublayer_2.1
(invisible)        Sublayer_2.2
(invisible)        Sublayer_2.3
(visible)        Layer_3

I need to change the visibility of each sublayer in a selected layer in turn and export the entire image with all visible layers.

For example:

(visible)        Layer_1
(visible)            Sublayer_1.1
(invisible)          Sublayer_1.2
(visible)        Layer_2
(visible)         Sublayer_2.1
(invisible)        Sublayer_2.2
(invisible)        Sublayer_2.3
(visible)        Layer_3

Export image_2.1.png

then

(visible)        Layer_1
(visible)            Sublayer_1.1
(invisible)          Sublayer_1.2
(visible)        Layer_2
(invisible)      Sublayer_2.1
(visible)         Sublayer_2.2
(invisible)        Sublayer_2.3
(visible)        Layer_3

Export image_2.2.png

then 

(visible)        Layer_1
(visible)            Sublayer_1.1
(invisible)          Sublayer_1.2
(visible)        Layer_2
(invisible)        Sublayer_2.1
(invisible)      Sublayer_2.2
(visible)         Sublayer_2.3
(visible)        Layer_3

Export image_2.3.png


The best that I did with the help of ChatGPT is this plug-in in Python:

Code:
#!/usr/bin/env python

from gimpfu import *

def export_sublayers(image, drawable, layer_name, path, prefix):
   # Find the target layer
   target_layer = None
   for layer in image.layers:
       if layer.name == layer_name:
           target_layer = layer
           break

   # If the target layer is found
   if target_layer:
       # Iterate through sublayers
       for sublayer in target_layer.children:
           # Make the current sublayer visible and others invisible
           for child in target_layer.children:
               pdb.gimp_item_set_visible(child, child == sublayer)

           # Export the image
           path = path + "\\" if not path.endswith("\\") else path
           filename = path + prefix + "_" + sublayer.name + ".png"
           pdb.file_png_save_defaults(image, image.active_layer, filename, filename)

       # Make all sublayers visible again
       for sublayer in target_layer.children:
           pdb.gimp_item_set_visible(sublayer, True)

register(
   "python_fu_combine_layers_and_export",
   "Combine layers and export",
   "Combine layers and export",
   "Your Name",
   "Your Name",
   "2024",
   "<Image>/File/Combine layers and export",
   "*",
   [
       (PF_STRING, "layer_name", "Layer name", ""),
       (PF_DIRNAME, "path", "Export path", "/path/to/export/"),
       (PF_STRING, "prefix", "Prefix", "")
   ],
   [],
   export_sublayers)

main()

But this plug-in exports only sublayers in a selected layer and I can't make it export the entire image with all visible layers.

Is anybody able to help me with it, please?

Or maybe are there other ways to do it?

Many thanks for any help!

Print this item

  ModuleNotFoundError
Posted by: gimpygirl - 03-01-2024, 06:28 PM - Forum: Extending the GIMP - Replies (3)

Hi

I have installed both GIMP 2.10.36 and GIMP 2.99.18 (to test plugins), both in another folder of course (Windows 10).

Running plugins in GIMP 2.10.36  works fine, but in GIMP 2.99.18 I have this error when running the same plugin.
I know you must put your plugin in a subfolder for GIMP 2.99.18  and I have done that.

If I use this line in a plugin


Code:
from gimpfu import *

I get following error in the terminal

Code:
line 3, in <module>
   from gimpfu import *
ModuleNotFoundError: No module named 'gimpfu'

Print this item

  ofnuts scripts and plugins GIMP 2.99.18
Posted by: gimpygirl - 03-01-2024, 06:26 PM - Forum: Extending the GIMP - Replies (3)

are all the ofnuts scripts and plugins working in GIMP 2.99.18?

Print this item

  Yahoo.co.uk Spam Filter
Posted by: programmer_ceds - 03-01-2024, 05:05 PM - Forum: Watercooler - Replies (10)

Does anyone else have problems with Yahoo.co.uk putting emails into spam? - particularly those from this forum that now all end up in spam. It doesn't seem possible to turn off spam filtering (at the moment I get very few actual spam emails - perhaps that's tempting fate!). I have the forum email address in the list of contacts - which is what yahoo suggest - but it makes no difference.

This means that using Thunderbird on the PC or K9 on my mobile I have no notification of replies on this site.

Print this item

  Searching for instruction
Posted by: Danbor - 02-29-2024, 11:26 PM - Forum: General questions - Replies (5)

Hello all. Looking for some specific schooling. I don't know if I have poor search skills, or if what I seek just doesn't exist.
   Being totally new to photo editing and new to Gimp, I am looking for some training in a specific area. So far without much luck. I have taken two Udemy courses already. The first, "Gimp 2.10 Masterclass: From beginner to pro photo editing", was good to get me familiar with concepts and the UI for Gimp. The second, "Gimp photo editing crash course" was pretty much useless for me.
   The first course focused on media design and the second focused on editing photos taken with a digital camera. Both useful and popular pursuits. However, of very little help for me. I am not creative and have no interest at all in pursuing any aspect of media or graphic design. I am not a picture taker so I have no digital photos to edit.
   What I do have are several hundred photos, from the early 1930's to the late 1990's that I want to scan and restore in digital form to share with family and comrades.
   So, does anyone know where a person can find a course of training that concentrates on using Gimp to repair and restore both color and black and white photographs?

Print this item

  Rectangle line thickness
Posted by: Peter Linu - 02-29-2024, 11:23 PM - Forum: General questions - Replies (1)

Hiyall,
Absolute Beginner here.

I want to create a rectangle around a piece of text and make the line a bit thicker.
I found the rectangle tool but can't find how to make it thicker.

Grateful for any advice.

Print this item

  Text Style
Posted by: petyusa - 02-29-2024, 10:43 PM - Forum: General questions - Replies (1)

Hi,

I've just started using GIMP a few weeks ago. I add a lot of text to images, but sometimes I have to change font size, style, etc. Is there a way, to set a preset for a givent text layer, and later just edit it, and it will update all text layers with the preset?

Print this item

  small plugin code help
Posted by: gimpygirl - 02-29-2024, 07:21 PM - Forum: Scripting questions - Replies (17)

Hi

I have this plugin that just runs some other scripts and plugins.

I want to add the first 2 comments lines. Can somebody tell me if this is possible and fill in the required code?
The plugin works but the 2 first comment lines I don't know how to code it.

First I want to add an alpha layer to my image.

Then I want to apply "select by color" tool on a specified pixel (X and Y value of the pixel) and delete the selection from  the whole image automatically? Is this possible using code?


Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
from gimpfu import*


def test(timg, tdrawable):

#how to add alpha layer to my image?

#how to apply "select by color" tool on a specified pixel and delete the selection from  the whole image?

#determine the offset values manually
   pdb.gimp_drawable_offset(tdrawable, 0, 1, 18, -32)
   
   
#the image size is constant and 150x150 crops the border    
   pdb.gimp_image_crop(timg, 2400, 1200, 150, 150)
   
   
#guides using script-fu    
   pdb.script_fu_grid_guides(timg, 0, 150, 150, 1, 0)
   
   
#chop into 150x150 tiles    
   pdb.python_fu_ofn_guillotine_layer(timg, tdrawable)
   
   
#export all layers
   pdb.python_fu_ofn_export_layers(timg, os.path.dirname(timg.filename), "{numUp0}.png", "-", 0)
    
    
register(
       "test",
       "test",
       "test",
       "*",
       "*",
       "2024",
       "<Image>/Tools/test...",
       "*",
       [],
       [],
       test
       )

main()

Print this item