Hi all,
I've been using Gimp for years on a fairly basic level. Recently I have been doing a lot of image stitching - there's overlap in the individual images so I just bring them in as layers, reduce the top level opacity, match positions, return it to full opacity and merge down. Not difficult but repetitive.
I make a lot of use of keyboard shortcuts ("Accelerators") and the preset "10% more Transparent" is great but I generally need to press it 3 or 4 times to get a useable level of transparency.
That got me thinking about Gimp's scripting potential, something I've never looked at before - "set active level to 60% opacity" with a single keypress would be so useful for me.
I'm very familiar with html and Office VBA but my first looks at python-fu have me very confused. If I just want this function do I have to create a plug-in and register it then get it to appear in the list of available commands so I can assign a combination of keys? The python console itself is already pretty confusing.
I think I've got something that could maybe do what I want but I can't figure how to run it to see what happens in order to debug. Then again maybe I'm completely off track...
➤> image = gimp.image_list()[0]
➤> active_layer = pdb.gimp_image_get_active_layer(image)
➤> pdb.gimp_layer_set_opacity(active_layer, 60)
Any help with solving this would be greatly appreciated.
I've been using Gimp for years on a fairly basic level. Recently I have been doing a lot of image stitching - there's overlap in the individual images so I just bring them in as layers, reduce the top level opacity, match positions, return it to full opacity and merge down. Not difficult but repetitive.
I make a lot of use of keyboard shortcuts ("Accelerators") and the preset "10% more Transparent" is great but I generally need to press it 3 or 4 times to get a useable level of transparency.
That got me thinking about Gimp's scripting potential, something I've never looked at before - "set active level to 60% opacity" with a single keypress would be so useful for me.
I'm very familiar with html and Office VBA but my first looks at python-fu have me very confused. If I just want this function do I have to create a plug-in and register it then get it to appear in the list of available commands so I can assign a combination of keys? The python console itself is already pretty confusing.
I think I've got something that could maybe do what I want but I can't figure how to run it to see what happens in order to debug. Then again maybe I'm completely off track...
➤> image = gimp.image_list()[0]
➤> active_layer = pdb.gimp_image_get_active_layer(image)
➤> pdb.gimp_layer_set_opacity(active_layer, 60)
Any help with solving this would be greatly appreciated.