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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,044
» Latest member: Donaldfuh
» Forum threads: 7,766
» Forum posts: 42,171

Full Statistics

Latest Threads
Chuck Henrich interactive...
Forum: Extending the GIMP
Last Post: denzjos
52 minutes ago
» Replies: 2
» Views: 146
erasing paintbrush stroke...
Forum: General questions
Last Post: denzjos
1 hour ago
» Replies: 1
» Views: 25
Single single-window mode...
Forum: General questions
Last Post: teapot
4 hours ago
» Replies: 0
» Views: 25
Palettes
Forum: General questions
Last Post: sallyanne
5 hours ago
» Replies: 3
» Views: 143
Help and advice with this...
Forum: General questions
Last Post: denzjos
Yesterday, 05:41 PM
» Replies: 7
» Views: 255
DOSBox-X release January ...
Forum: Other graphics software
Last Post: rich2005
Yesterday, 09:20 AM
» Replies: 1
» Views: 130
3.0.6 appimage crash on R...
Forum: Alternate Gimp packagings
Last Post: rich2005
Yesterday, 08:38 AM
» Replies: 1
» Views: 141
Menus in 3.0
Forum: General questions
Last Post: rich2005
01-02-2026, 10:28 AM
» Replies: 1
» Views: 191
ExifToolGUI and ExifTool ...
Forum: Other graphics software
Last Post: denzjos
01-02-2026, 08:27 AM
» Replies: 11
» Views: 11,731
Wallpaper
Forum: Gallery
Last Post: diagramjamal1
01-01-2026, 10:17 PM
» Replies: 3
» Views: 2,837

 
  GEGL Drop Shadow: A New Attempt
Posted by: BaconWizard17 - 01-10-2024, 04:17 PM - Forum: Scripting questions - Replies (1)

Hi all,

I've been trying to figure out how to set up a script that will do a drop shadow with the GEGL drop shadow filter. This is something I've wanted to do in the past, but didn't get any traction on it. Since then, I've found what seems like a possible solution, but I'm having issues actually implementing it.

I did this thread with a way to use GEGL with Python-Fu (is there a more current way to do this?), and I also found this set of scripts that transcribe the various GEGL operations into individual Python-Fu scripts (again, is there something more current than this?). I have both scripts in my Plug-Ins folder. If I use the drop shadow script from the "GEGL as Python" toolbar in Gimp, it works great. My question is how to properly code that into a script.

Here's the drop shadow script from MareroQ:

Code:
def gegl_dropshadow(image, layer, shadow_offset_x, shadow_offset_y, shadow_blur, grow_shape, grow_radius, color_s, shadow_opacity):

   color_to_gegl=rgb_to_hex(color_s)
   if grow_shape==0:
       grow_s='square'
   if grow_shape==1:
       grow_s='circle'
   if grow_shape==2:
       grow_s='diamond'
        
   gegl_graph_string="gegl:dropshadow x=%d y=%d radius=%d grow-shape=%s grow-radius=%d color=%s opacity=%f" % (shadow_offset_x, shadow_offset_y, shadow_blur,grow_s,grow_radius, color_to_gegl, shadow_opacity)
   pdb.python_fu_gegl_graph(image, layer, gegl_graph_string)
register(
   "python_fu_gegl_dropshadow",
   "GEGL to Python. Works on the active layer",
   "Creates a dropshadow effect on the input buffer",
   "Auto Author",
   "Auto Author",
   "Auto Generated Dated",
   "<Image>/GEGL as Python/gegl-dropshadow...",             #Menu path
   "*",
   [

   (PF_SPINNER, "shadow_offset_x", "Shadow Offset X:", 5, (-1000, 1000, 1)),
   (PF_SPINNER, "shadow_offset_y", "Shadow Offset Y:", 5, (-1000, 1000, 1)),
   (PF_SPINNER, "shadow_blur",     "Shadow Blur Radius:", 5, (0, 300, 1)),
   (PF_OPTION,  "grow_shape",      "Grow Shape: ", 0, [" Square "," Circle ", " Diamond "]),    
   (PF_SPINNER, "grow_radius",     "Grow Radius:", 5, (-100, 100, 1)),
   (PF_COLOR,   "color_s",         "Color:", (0, 0, 0)),
   (PF_FLOAT,   "shadow_opacity",  "Shadow Opacity (default:1.5, 0..2):", 1.5)      # (0, 2, 0.01)),  
   ],
   [],
   gegl_dropshadow)

Here's my attempt at implementing that into my own script:

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

from gimpfu import*

def generate_hud_outline(image, layer):
   pdb.gimp_image_undo_group_start(image)
   pdb.gimp_selection_none(image)
   pdb.python_fu_gegl_dropshadow(image, layer, 0.00, 0.00, 2.00, "circle", 1, gimpcolor.RGB(0,0,0), 1.25)
   pdb.gimp_displays_flush()
   pdb.gimp_image_undo_group_end(image)

register(
   "python_fu_marvelmods_common_generate_hud_outline",
   "Generates an outline for a conversation portrait.",
   "Generates an outline for a conversation portrait.",
   "BaconWizard17",
   "BaconWizard17",
   "January 2024",
   "Generate Conversation Portrait (HUD) Outline",
   "*",
   [
       (PF_IMAGE, "image", "Input image", None),
       (PF_DRAWABLE, 'drawable', 'Layer, mask or channel', None)
   ],
   [],
   generate_hud_outline,
   menu='<Image>/Marvel Mods/Utilities'
)

main()

However, this script keeps failing, and I'm not sure why. If I run it from the toolbar, the error console gives an error that says
"GIMP Warning
Plug-in 'Generate Conversation Portrait (HUD) Outline' left image undo in inconsistent state, closing open undo groups."

If I try to run it in the Python-Fu console using this method, it crashes and I get the following error in the error console:
"GIMP Error
Plug-in crashed: "python-console.py"
(C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins\python-console\python-console.py)

The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side."

Any thoughts on what I could be doing wrong? I'm using GIMP 2.10.36 on Windows 10.

Print this item

  tutorial allowing you to position an animated image (.gif) on a jpg image
Posted by: jps0302 - 01-10-2024, 03:01 PM - Forum: General questions - Replies (5)

Hi,


I am looking for a tutorial or a procedure allowing you to position an animated image (.gif) on a jpg image.
I use version 2.10 of Gimp

Thank you for your answers

Print this item

  Deepdreamgenerator AI images
Posted by: diagramjamal1 - 01-10-2024, 12:12 PM - Forum: Gallery - Replies (2)

https://deepdreamgenerator.com/u/diagramjamals
   

Print this item

  The 'mouse keeping' mouse - was it transgenic?
Posted by: Tas_mania - 01-10-2024, 10:57 AM - Forum: Watercooler - Replies (1)

Many people saw the clip on TV dubbed 'mouse keeping'by some outlets.

   

It's kind of entertaining and this behavior is typical of rodents. In the US rodents that live in abandoned mines are called 'pack rats'.
10 years ago mice with human dna were already being developed in the UK.
So how many of those modified mice ended-up in people's sheds doing some house work?



[url=https://www.independent.co.uk/news/science/exclusive-mice-with-human-chromosomes-the-genetic-breakthrough-that-could-revolutionise-medicine-8701357.html][/url]

Print this item

Question How can I use GIMP to batch process .png files?
Posted by: Rapidfly - 01-09-2024, 08:52 PM - Forum: General questions - Replies (5)

I'm working on recolouring resource asset files for iTunes to create a dark mode theme - I managed to extract the files and now I'm searching a way to modify the extracted .png files.

The directory looked like this:
[Image: bef.png]

I went through the first 50 or so files manually adjusting the hue/saturation in Photoshop and they are starting to look much more like a dark mode theme:
[Image: aft.png]

Although manually editing them was a sound approach for testing the alterations, there are around 3000 extracted .png files in total so I'm searching for a way to process all of these files as a batch.

I was wondering if there was a way that GIMP could do this - perhaps a script that replaces certain colours with other colours so that it would be possible to create a variety of skins/themes in the future, for many different software. A script that could replicate the photoshop changes (hue/saturation adjustments) as a batch would suffice too as I would still be able to create a very basic dark mode theme for the community.

Print this item

  Get rid of thin pic border after Crop
Posted by: GMP - 01-09-2024, 07:19 PM - Forum: General questions - Replies (4)

I cropped a pic and it looks fine except I didn't quite get the very outside border of the pic. So there's a tiny line at the top and the right. I did it right on the left. I tried to fix it with the Crop tool, but it didn't work. I tried the Eraser tool, but I couldn't get it to work, since I've never used it before. What the best way to fix this?


I tried the Eraser tool again, and this time it worked. Not sure what I was doing wrong, except this time I chose the tool from the icons on the left

Print this item

  How to write a script for bundle editing yellow photos
Posted by: Stephen Liu - 01-09-2024, 09:35 AM - Forum: General questions - Replies (2)

Hi all,

I have bundles for old yellowish photos to restore.

I run GUI commands/steps to do the job.  Can I write a script to do the job if I found the GUI commands/steps suitable after testing?

I have no idea of the back-end commands.  Please advise.  Thanks.

Regards

Print this item

Wink Font missing after instal on M3 Pro Sonoma 14.1.2
Posted by: Frah - 01-07-2024, 04:14 PM - Forum: OSX - Replies (5)

Hi,

I installed Gimp 2.10.36 a week ago on my new Macbook M3 Pro Apple Silicon with OXS Sonoma 14.1.2.

Right after booting Gimp, I noticed that instead of letters, "codes" were scrolling through the screen.
   
Once booted, the problem persisted. 

A week of searching on the internet for now only yields many (too) vague clues, but no clear answer, hence my question; 
What is wrong, and how do I fix this ?

Regards,
Frah

Print this item

  Changing this image to be transparent
Posted by: tm2383 - 01-06-2024, 09:08 PM - Forum: General questions - Replies (3)

I work as a teacher for the visually impaired (VI) and I need to make this image of a special protractor transparent, leaving the black lines and numbers, so that I can demonstrate it being used to measure angles on an interactive screen. The protractors which come with the screen software aren't VI ones. 
I have looked at tutorials, but haven't successfully managed to do this. How would I go about doing this?



Attached Files Thumbnail(s)
   
Print this item

  Select hair, again. However, not outside of head!
Posted by: N00BELIX - 01-06-2024, 05:19 PM - Forum: General questions - Replies (4)

Hi all. I am close to giving up on this one, and need help from you good people.
I have seen all videos and read all tutorials i can find, but i am still stuck.

A problem with these tutorials are that they use quality images. The one i have been given are most likely been taken with a toaster.
It is about the hairline. I can for the life of me not get a good selection. After trying freehand for i while, i realized that it simply is not good enough, Help!

Print this item