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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,916
» Latest member: BorrowedWifi
» Forum threads: 7,362
» Forum posts: 40,094

Full Statistics

Latest Threads
Converting python plugin-...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: n3306tx
44 minutes ago
» Replies: 43
» Views: 4,232
Script-Fu in GIMP 3 websi...
Forum: Extending the GIMP
Last Post: crogonint
7 hours ago
» Replies: 2
» Views: 476
AIGoR - Artificial Image ...
Forum: Other graphics software
Last Post: vitforlinux
8 hours ago
» Replies: 7
» Views: 687
RemoveBG, how to install ...
Forum: Extending the GIMP
Last Post: rich2005
Today, 09:11 AM
» Replies: 13
» Views: 488
Cannot install gimp-help ...
Forum: General questions
Last Post: rich2005
Today, 08:30 AM
» Replies: 3
» Views: 699
selecting a fixed size re...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
Yesterday, 12:30 PM
» Replies: 4
» Views: 214
New color : olo
Forum: Watercooler
Last Post: denzjos
Yesterday, 07:51 AM
» Replies: 0
» Views: 103
Windows Portable Gimp 3.0...
Forum: Alternate Gimp packagings
Last Post: rich2005
04-19-2025, 07:57 PM
» Replies: 0
» Views: 140
Masking/Cutting/Layering?
Forum: General questions
Last Post: rich2005
04-19-2025, 07:43 PM
» Replies: 1
» Views: 152
Need help installing Resy...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
04-19-2025, 05:58 PM
» Replies: 3
» Views: 226

 
  Gimp 3 Python Script - Merge Visible - No Flatten Image?
Posted by: silenuznowan - 03-31-2025, 05:48 PM - Forum: Extending the GIMP - Replies (6)

Not sure if this is a problem with the documentation or if it's a bug, maybe someone here can shed some light.

I'm converting my Gimp 2 scripts to Gimp 3 and noticed that in v3 there is a new merge type listed in the docs for the description of:
gimp-image-merge-visible-layers

Under the parameters it lists:

Quote:The type of merge { EXPAND-AS-NECESSARY (0), CLIP-TO-IMAGE (1), CLIP-TO-BOTTOM-LAYER (2), FLATTEN-IMAGE (3) }, default EXPAND-AS-NECESSARY (0)


However calling gimp-image-merge-visible-layers , like so:


Code:
layer = merge_visible(img, Gimp.MergeType.FLATTEN_IMAGE)


Where merge_visible looks like this:


Code:
def merge_visible(image: Gimp.Image, merge_type: Gimp.MergeType = Gimp.MergeType.EXPAND_AS_NECESSARY)->Gimp.Layer:
    """
    Merge the visible layers of an image into a single layer.
    This procedure combines the visible layers into a single layer using the specified merge type.
    A merge type of EXPAND_AS_NECESSARY expands the final layer to encompass the areas of the visible layers.
    A merge type of CLIP_TO_IMAGE clips the final layer to the extents of the image.
    A merge type of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost layer.

    :param image: Gimp image with the layers to be merged
    :param merge_type: the type of merge:
        0 = Expand as Necessary
       1 = Clip to image
        2 = clip to bottom
        3 = Flatten Image

        default = Expand as Necessary
    :return: The merged layer
    """
    procedure = Gimp.get_pdb().lookup_procedure('gimp-image-merge-visible-layers')
    config = procedure.create_config()
    config.set_property('image', image)
    config.set_property('merge-type', merge_type)
    result = procedure.run(config)
    success = result.index(0)
    layer = result.index(1)
    return layer


However this results in an error:


Quote:GIMP-Error: Calling error for procedure 'gimp-image-merge-visible-layers':

Procedure 'gimp-image-merge-visible-layers' has been called with value 'GIMP_FLATTEN_IMAGE' for argument 'merge-type' (#2, type GimpMergeType). This value is out of range.

Thanks,
Jordan

Print this item

  Gimp 3.0.0 (and newer) Copying layers/images and pasting and Alignment Tool
Posted by: Imc7r - 03-31-2025, 05:26 PM - Forum: Gimp 2.99 & Gimp 3.0 - No Replies

3 points I noticed

1) Pasting: 'Paste as new layer' in Gimp 2.10 is now called just 'Paste'

'Paste' in 2.10 Ctr+V is now called 'Paste As Floating Data' - this is to have a floating selection from the pasted layer like before.
no bugs with this just the difference, defaults to pasting as new layer unless Ctr+V is changed to paste as floating like I did

2) If you have Layer 1 that is 1000x1000 for example and a top layer 2 that is 256x256 but you did not make the top layer 'Layer to Image size'. You just want to copy the top layer 2 to clipboard or another new file or image.

I noticed that Ctrl+C to copy that layer copies it as if you merged layer 2 down to layer 1. In 2.10 you just copy the upper layer and it pastes with the border size of the layer not with the borders of the lower layer that is bigger. Is this intended

https://gitlab.gnome.org/-/project/1848/...3ee8/1.jpg

3) The Align tool works a bit differently - If you want to move for example the black image have to untick, choose position then tick, so it doesn't align halfway off the canvas or border of the lower image/BG

   

Print this item

  David's Batch Processor i V3.0
Posted by: AfTech54 - 03-31-2025, 09:47 AM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (2)

I've used David's Batch Processor (Dbp) in v 2.10, the Dbp plugin appears in the Filter menu.
I've got the Dvp file in a MS OneDrive (OD) folder so I have access to my custom settings in my both computers.

Now I've added the (OD) folder to Settings/Folders/Plugins in V 3.0.2 but the plugin doesn't show up under the Filter menu.

I've also added the Dbp file to:
C:\Users\Roger\AppData\Local\Programs\GIMP 3\lib\gimp\3.0\plug-ins
C:\Users\Roger\OneDrive\Roger Private\OD GIMP Set\Custom\plug-ins

I've closed and started GIMP after each task.

Is the Dbp not compatible with Gimp 3, if so - is there any similar plugin working in V3.0?

Print this item

  resynthesizer
Posted by: Gimper@PP - 03-31-2025, 09:26 AM - Forum: Extending the GIMP - Replies (3)

Hey, I use windows 11 + gimp 3.0.2 and i will install resynthesizer but i get it not install.

I get the last version of resynthsizer from github 

I install it in preferences - map - plug-ins in gimp 3.0.2
What am i doing wrong?

Print this item

  Converting Gimp Files to JPEG
Posted by: scave - 03-30-2025, 10:11 PM - Forum: General questions - Replies (3)

I have many photos stored on my hard drive. They were saved as JPEG. Somehow I clicked something in Gimp I think, that converted them all to a Gimp filea.  What can I do to convert the photos on my hard drive back to JPEG?  In Gimp they show as JPEG.   Is there a one click thing that will convert them (one's on hard drive) back to JPEG?  Also, I am using 3.02(revision 1). That was not a choice I could select when I registered.
Thank you,
Scave

Computer Screen:
   

Gimp Screen:
   

Print this item

  Transforming an image?
Posted by: Knusbrich - 03-30-2025, 06:31 PM - Forum: General questions - Replies (1)

First of all, I would like to mention that I am an absolute beginner in using GIMP.

I have a picture of a fence photographed from a drone. The fence looks like an ellipse in the picture, but in reality the fence is square. I have studied various videos on Youtube, but have not found one that helps me further. I imagine a kind of free transform tool where you can push and pull the frame of the picture in different places, so that the fence becomes more square. In short, it is described as changing an ellipse to a square. Does anyone have a link to a tutorial or a plugin that can help with this task?

Print this item

  Converseen batch image processor
Posted by: denzjos - 03-30-2025, 07:09 AM - Forum: Other graphics software - No Replies

Converseen is a free cross-platform batch image processor for Windows, Linux, macOS, FreeBSD, and other operating systems. It allows you to convert, resize, rotate, and flip an infinite number of images with a single mouse click. Moreover, Converseen can convert an entire PDF document into a set of images with your preferred characteristics. You can choose from over 100+ formats, set the size, resolution, and the filename.

https://converseen.fasterland.net

Print this item

Photo size of image in editing window
Posted by: Stevend - 03-29-2025, 05:59 PM - Forum: Windows - Replies (2)

Hi first time user here, have (rarely) used the P8888shop (sorry if thats a swear word) before but I am finding Gimp (3.0.2.1) a Steep learning curve.

All I am trying to do at the moment is find out how to make an image appear full size in the editing window rather than it being so fiddly small.  I found something onling about scaling but I am not trying to change the size of the image, I just want it to show as large as the window will allow without changing aspect ratio. In other software there is a simple "show image to window size" or something like that.
 

I am running W11 Pro 64bit patched upto date. 

I have attached an example picture which shows how much unused space in the editing window is wasted. I cant believe this needs more than a single "click" somewhere to make this the default??

Any help appreciated.



Attached Files
.pdf   small image.pdf (Size: 206.93 KB / Downloads: 36)
Print this item

  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