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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,798
» Latest member: jowindo
» Forum threads: 7,602
» Forum posts: 41,428

Full Statistics

Latest Threads
Is there any version wher...
Forum: Older Gimp versions (2.8, 2.6....)
Last Post: HavingTooMuchFun
2 hours ago
» Replies: 3
» Views: 778
Batch export all opened i...
Forum: Extending the GIMP
Last Post: rich2005
8 hours ago
» Replies: 24
» Views: 14,160
Dodge and burn plug-in fo...
Forum: Extending the GIMP
Last Post: chuckhenrich
11 hours ago
» Replies: 0
» Views: 74
cannot find plu-gins in g...
Forum: General questions
Last Post: πk2
Yesterday, 08:46 AM
» Replies: 3
» Views: 304
ora format... it really w...
Forum: General questions
Last Post: mrkid
09-17-2025, 10:57 PM
» Replies: 3
» Views: 318
.pcd files issue?
Forum: OSX
Last Post: T1-Survivor
09-17-2025, 09:45 PM
» Replies: 3
» Views: 562
Simplifying a path
Forum: Extending the GIMP
Last Post: Ofnuts
09-17-2025, 03:17 PM
» Replies: 40
» Views: 35,669
"Gimp 2.99 & Gimp 3.0" fo...
Forum: Gimp-Forum.net
Last Post: Ofnuts
09-17-2025, 03:12 PM
» Replies: 0
» Views: 285
Coincidence or not, that ...
Forum: Watercooler
Last Post: Krikor
09-17-2025, 12:57 PM
» Replies: 2
» Views: 1,307
How do you make text circ...
Forum: General questions
Last Post: Krikor
09-17-2025, 12:40 PM
» Replies: 13
» Views: 3,968

 
Bug Single Dose - Glossy stroke 3d.py
Posted by: Krikor - 01-18-2022, 10:54 AM - Forum: Extending the GIMP - Replies (22)

Hello everyone!

Plugin: glossy_stroke_3d.py; (I don't remember where I got it)
Author Eric Leroy;
Date: 2010;

Problem:
The plugin only works once for every Gimp restart.

After a single use, the plugin stops responding. Requiring the Gimp to be restarted so that in just one more instance the plugin will run again.

The plugin can be found in <Image>/Filters/Light and Shadow

Would it be possible to detect the cause of this problem and somehow fix it?

PHP Code:
#! /usr/bin/env python

###############################################################################
# The GIMP -- GNU image manipulation program
# Copyright (c) 1995-2010
# Spencer Kimball, Peter Mattis and the GIMP Development Team
#
# glossystroke3d
# Version 1.2.0 (For the GIMP 2.6), 15 Dec 2010
# Stroke the current selection, create a 3D effect and a dropped shadow
# Adapted from the tutorial: "iText tutorial" of Craig Marshall & Phil Harper. 
# Published in http://gug.criticalhit.dk/tutorials/itext2/
#
# Copyright (c) 2010 Eric Leroy (eral) kelk1@hotmail.com
# -----------------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
###############################################################################

from gimpfu import *

def python_glossy_stroke_3d(
 
   imglayerfg_colorbrushstrokeroundingls_colorls_zglow
 
   brightshinepolishsh_colords_xds_yds_blurds_opac) :

 
   pdb.gimp_undo_push_group_start(img)

 
   # save some values
 
   cur_color pdb.gimp_context_get_foreground()
 
   cur_brush pdb.gimp_context_get_brush()
 
   img_w pdb.gimp_image_width(img)
 
   img_h pdb.gimp_image_height(img)
 
   cur_sel pdb.gimp_selection_save(img)

 
   # stroke the selection
 
   stroke_layer pdb.gimp_layer_new(
 
       img              # IMAGE
 
       img_w            # WIDTH
 
       img_h            # HEIGHT
 
       RGBA_IMAGE       # RGBA TYPE
 
       "stroke_layer"   # NAME
 
       100              # OPACITY
 
       NORMAL_MODE        # NORMAL MODE
 
       )
 
   pdb.gimp_image_add_layer(imgstroke_layer, -1)
 
   pdb.gimp_image_set_active_layer(imgstroke_layer)
 
   pdb.gimp_context_set_foreground(fg_color)
 
   pdb.gimp_context_set_brush(brush)
 
   if stroke == 0:
 
     pdb.gimp_edit_stroke(stroke_layer)
 
   else:
 
     pdb.gimp_edit_bucket_fill(
 
         stroke_layer   # DRAWABLE
 
         FG_BUCKET_FILL # FILL W/ FG
 
         NORMAL_MODE    # NORMAL PAINT MODE
 
         100.0          # 100% opacity
 
         0              # TRESHOLD
 
         False          # DO NOT USE THE COMPOSITE IMG
 
         0              # NOT USED
 
         0                # NOT USED
 
         )


 
   # save selected stroke to channel
 
   pdb.gimp_selection_layer_alpha(stroke_layer)
 
   sel_chan pdb.gimp_selection_save(img)

 
   # create volume
 
   pdb.gimp_selection_shrink(imgrounding)
 
   volume_layer pdb.gimp_layer_new(
 
       img              # IMAGE
 
       img_w            # WIDTH
 
       img_h            # HEIGHT
 
       RGBA_IMAGE       # RGBA TYPE
 
       "volume_layer"   # NAME
 
       100              # OPACITY
 
       NORMAL_MODE        # NORMAL MODE
 
       )
 
   pdb.gimp_image_add_layer(imgvolume_layer, -1)
 
   pdb.gimp_image_set_active_layer(imgvolume_layer)
 
   pdb.gimp_context_set_foreground((255255255))
 
   pdb.gimp_edit_bucket_fill(
 
       volume_layer     # DRAWABLE
 
       FG_BUCKET_FILL   # FILL W/ FG
 
       NORMAL_MODE      # NORMAL PAINT MODE
 
       100.0            # 100% opacity
 
       0                # TRESHOLD
 
       False            # DO NOT USE THE COMPOSITE IMG
 
       0                # NOT USED
 
       0                  # NOT USED
 
       )
 
   pdb.gimp_selection_none(img)
 
   pdb.plug_in_gauss(
 
       img              # IMAGE
 
       volume_layer     # DRAWABLE
 
       rounding 2.0   # HORIZONTAL BLURRING RADIUS
 
       rounding 2.0   # VERTICAL BLURRING RADIUS
 
       0                  # IIR (0) OR RLE (1)
 
       )
 
   pdb.gimp_layer_set_mode(volume_layerOVERLAY_MODE)
 
   volume_layer_copy pdb.gimp_layer_copy(volume_layerTrue)
 
   pdb.gimp_image_add_layer(imgvolume_layer_copy, -1)

 
   # create lighting effect
 
   pdb.gimp_image_set_active_channel(imgsel_chan)
 
   pdb.plug_in_gauss(imgsel_chanrounding 2.0rounding 2.00)
 
   glossy_layer pdb.gimp_layer_new(
 
       img              # IMAGE
 
       img_w            # WIDTH
 
       img_h            # HEIGHT
 
       RGBA_IMAGE       # RGBA TYPE
 
       "glossy_layer"   # NAME
 
       100              # OPACITY
 
       SCREEN_MODE        # SCREEN
 
       )
 
   pdb.gimp_image_add_layer(imgglossy_layer, -1)
 
   pdb.gimp_image_set_active_layer(imgglossy_layer)
 
   pdb.gimp_selection_load(sel_chan)
 
   pdb.gimp_context_set_foreground((000))
 
   pdb.gimp_edit_bucket_fill(
 
       glossy_layer     # DRAWABLE
 
       FG_BUCKET_FILL   # FILL W/ FG
 
       NORMAL_MODE      # NORMAL PAINT MODE
 
       100.0            # 100% opacity
 
       0                # TRESHOLD
 
       False            # DO NOT USE THE COMPOSITE IMG
 
       0                # NOT USED
 
       0                  # NOT USED
 
       )
 
   pdb.gimp_selection_none(img)
 
   if ds_x ds_y:
 
     if ds_y == 0:
 
       ls_x = -ds_x
        ls_y 
0
      else
:
 
       ls_x = -ds_x abs(ds_y)
 
       ls_y = -ds_y abs(ds_y)
 
   else:
 
     if ds_x == 0:
 
       ls_x 0
        ls_y 
= -ds_y
      else
:
 
       ls_x = -ds_x abs(ds_x)
 
       ls_y = -ds_y abs(ds_x)

 
   pdb.plug_in_lighting(
 
       img              # IMAGE
 
       glossy_layer     # DRAWABLE
 
       sel_chan         # BUMP MAP
 
       None             # ENVIRONMENT MAP
 
       True             # ENABLE BUMPMAPPING
 
       False            # DISABLE ENVMAPPING
 
       0                # LINEAR BUMPMAP
 
       1                # DIRECTIONAL LIGHT SOURCE
 
       ls_color         # WHITE LIGHT SOURCE
 
       ls_x             # LIGHT POSITION X
 
       ls_y             # LIGHT POSITION Y
 
       ls_z             # LIGHT POSITION Z
 
       ls_x             # LIGHT DIRECTION X
 
       ls_y             # LIGHT DIRECTION Y
 
       ls_z             # LIGHT DIRECTION Z
 
       glow             # AMBIANT INTENSITY (GLOWING)
 
       bright           # DIFFUSE INTENSITY (BRIGHT)
 
       bright           # DIFFUSE REFLECTIVITY
 
       shine            # SPECULAR REFLECTIVITY (SHINY)
 
       polish           # HIGHLIGHT (POLISHED)
 
       True             # ANTIALIASING
 
       False            # SAME IMAGE
 
       False              # TRANSPARENT BACKGROUND
 
       )

 
   # drop shadow
 
   pdb.gimp_image_set_active_layer(imgstroke_layer)
 
   act_lay pdb.gimp_image_get_active_layer(img)
 
   pdb.gimp_selection_layer_alpha(act_lay)
 
   pdb.script_fu_drop_shadow(
 
       img             # IMAGE
 
       act_lay         # MASK LAYER
 
       ds_x            # X OFFSET
 
       ds_y            # Y OFFSET
 
       ds_blur         # BLUR RADIUS
 
       sh_color        # SHADOW COLOR
 
       ds_opac         # SHADOW LAYER OPACITY
 
       True              # ALLOW RESIZING
 
       )

 
   # restore initial state
 
   pdb.gimp_image_resize(
 
       img             # IMAGE
 
       img_w           # WIDTH
 
       img_h           # HEIGHT
 
       0               # X OFFSET
 
       0                 # Y OFFSET
 
       )
 
   pdb.gimp_selection_load(cur_sel)
 
   pdb.gimp_image_remove_channel(imgcur_sel)
 
   pdb.gimp_image_remove_channel(imgsel_chan)
 
   pdb.gimp_image_set_active_layer(imglayer)
 
   pdb.gimp_context_set_foreground(cur_color)
 
   pdb.gimp_context_set_brush(cur_brush)

 
   pdb.gimp_undo_push_group_end(img)
 
   return

register
(
 
   "python_fu_glossy_stroke_3d",
 
   "Stroke with a glossy 3-D effect and a dropped shadow",
 
   "Stroke with a glossy 3-D effect and a dropped shadow",
 
   "Eric Leroy",
 
   "Eric Leroy",
 
   "2010",
 
   "GlossyStroke 3D",
 
   "*",
 
   [
 
     (PF_IMAGE"image""Input image"None),
 
     (PF_DRAWABLE"drawable""Input layer"None),
 
     (PF_COLOR"fg_color""Color:", (0157255)),
 
     (PF_BRUSH"brush""Stroking brush:"None),
 
     (PF_OPTION"stroke""Selection:"0, ["Stroke""Fill"]),
 
     (PF_SPINNER"rounding""3D amount:"2, (0501)),
 
     (PF_COLOR"ls_color""Light color:", (255255255)),
 
     (PF_SPINNER"ls_z""Light height:"0.5, (0.020.00.1)),
 
     (PF_SPINNER"glow""Glowing:"5.0, (0.01000000.01)),
 
     (PF_SPINNER"bright""Brightness:"1.00, (0.01000000.01)),
 
     (PF_SPINNER"shine""Shiny:"5.0, (0.01000000.01)),
 
     (PF_SPINNER"polish""Polish:"30.0, (0.01000000.01)),
 
     (PF_COLOR"sh_color""Shadow color:", (000)),
 
     (PF_SPINNER"ds_x""Shadow offset X:"10, (-50501)),
 
     (PF_SPINNER"ds_y""Shadow offset Y:"10, (-50501)),
 
     (PF_SPINNER"ds_blur""Shadow blur radius:"15, (0501)),
 
     (PF_SLIDER"ds_opac""Shadow opacity:"80, (01001))
 
   ],
 
   [],
 
   python_glossy_stroke_3d,
 
   menu="<Image>/Filters/Light and Shadow")

main() 
Thanks for listening!

Print this item

  How to move text?
Posted by: nothing - 01-18-2022, 05:54 AM - Forum: General questions - Replies (2)

There are two layers. One is a background image and another one is text. The text is above the image. Every time I move the text with the move tool, the image is moved mostly. 
It works sometimes, but not mostly. Why does it happen and how do I figure it out?

Print this item

Wink Width of the boundary area
Posted by: saitoib - 01-18-2022, 12:53 AM - Forum: General questions - Replies (2)

Hi all.

I am trying to use the Gimp to create icons for CAD.
Icns for CAD are very  small, 16 or 32 pix, and often linear.
First, I drew the desired shape in CAD, reproduced this as a png shape of about 500 pix, and
then reduced the layer to 32 pix in Gimp.
However, it doesn't work because the color boundaries are blurred.
Is there any way to ajust the width of the boundary when shrinking the layer?

Thank you

Print this item

Video wacom shorcut gimp 2.10.30
Posted by: morphost - 01-17-2022, 05:44 PM - Forum: General questions - No Replies

os: windows 10
wacom:-PTH 850

Hello,
i have watching  a tutorial  video.
https://www.youtube.com/watch?v=AjyFQjP3wno&t=876s 
I would like custom my wacom with the gimp shortcut but when i put with the pen this don't working.
I have done a shortcut ex: search on gimp <shift/>
. But the shorcut in the wacom don't working.
Someone knows the fix ?

https://ibb.co/H7h9fph
https://ibb.co/9pYcWh2


Thank you

Print this item

Question GIMP 2.10.30 none of tools work anymore
Posted by: alain.roger - 01-17-2022, 03:05 PM - Forum: General questions - No Replies

Hi,

I have a weird situation.
I just discovered that under my ubuntu 21.10, none of GIMP tools (select, gradient, etc..) work anymore.
It's like all of them are here (not greyed) but do nothing on canvas or image.

Any idea what it could be ?

thx


I had to remove .conf/GIMP and .cache/gimp and reinstall gimp to make it works again

Print this item

Question gimprc not working
Posted by: pago159 - 01-17-2022, 12:55 PM - Forum: General questions - Replies (1)

Hello,
I am currently trying to package Gimp 2.10.30. One of the defaults is that no automatic updates are allowed. In the process I have the file gimprc under the following path:
C:\Program Files\GIMP 2\etc\gimp\2.0\gimprc
came to mind. However, in the user context all the settings I made are ignored. Why does this file have no effect? According to the introductory description, settings can be specified centrally in this file.

Print this item

  Transparency when resize.
Posted by: nothing - 01-17-2022, 08:02 AM - Forum: General questions - Replies (2)

Every time I resize a layer, I can't see the bottom layer. 
For instance: There are Layer 1 and Layer 2. The Layer 2 is over the Layer 1. I resize the Layer 2 and can't see the Layer 1, so I can't resize the Layer 2 whatever I want. 
Is there a way to make the upper layer transparent?

Print this item

  Size/Opacity
Posted by: snowhawk - 01-16-2022, 10:50 PM - Forum: General questions - Replies (1)

Hey, I am on version 20.10.30. I need to know how to adjust pen pressure for size/opacity at the same time, like Photoshop. How do I adjust the new brush dynamic? I don't see any way to edit brushes (new ones) .. I can change thing in the mapping matrix for a new brush, but it didnt change anything, even when I adjusted the curve.

So basically, how do you adjust pen pressure for size/opacity at the same time.

Thanks.

Print this item

  Overlaying image with brand colour
Posted by: beau_mash - 01-16-2022, 09:37 PM - Forum: General questions - Replies (1)

Hi there, please help!

I run a charity and our branding centres around a distinctive coral colour we used in all our images. Previously we've used Photoshop / InDesign for this, making a photo greyscale, then turning up the contrast, and finally layering it with that coral (see photo attached for an example).

I love the ethos of GIMP and would like us to move to it, but I can't quite achieve the same effect. I can do the greyscale and contrast steps just fine (I think), but when I've created a layer in our coral colour and made it part opaque the outcome is different. I'm sure there will be a way to do it, but I'm not sure what layer / mask effect I should be using.

Any help is gratefully received! Many thanks



Attached Files Image(s)
   
Print this item

  Reducing/Eliminating Star Halos
Posted by: Galbanese61 - 01-16-2022, 09:25 PM - Forum: General questions - Replies (1)

Hi All.

I just started using GIMP to edit my astrophotography images, and I am a complete newbie at GIMP but I am finding my way aound....
Does anyone out ther use GIMP to edit AP Images? And if so, has anyone found a way to reduce /eliminate large star halos?? Any and all help would be greatly appreciated. Thanks...in advance

Print this item