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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,650
» Latest member: andersenman
» Forum threads: 7,188
» Forum posts: 39,262

Full Statistics

Latest Threads
Bookmarks are not saved
Forum: Linux and other Unixen
Last Post: JaBo
Yesterday, 07:23 PM
» Replies: 4
» Views: 157
Can not make bookmarks fo...
Forum: Installation and usage
Last Post: JaBo
Yesterday, 07:20 PM
» Replies: 4
» Views: 173
Rotate Won't Work
Forum: General questions
Last Post: rich2005
Yesterday, 05:07 PM
» Replies: 5
» Views: 1,818
Too much gimp-version is ...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: vitforlinux
Yesterday, 03:17 PM
» Replies: 0
» Views: 88
Just Erase the Background...
Forum: General questions
Last Post: rich2005
Yesterday, 10:05 AM
» Replies: 4
» Views: 147
Eraser Stopped Working
Forum: General questions
Last Post: Ofnuts
Yesterday, 09:54 AM
» Replies: 11
» Views: 465
Save & Export?
Forum: General questions
Last Post: Ofnuts
02-25-2025, 10:10 PM
» Replies: 1
» Views: 126
scriptfu could says what ...
Forum: Scripting questions
Last Post: rich2005
02-25-2025, 12:01 PM
» Replies: 2
» Views: 176
adding UnitComboBox to a ...
Forum: Scripting questions
Last Post: Ofnuts
02-25-2025, 07:05 AM
» Replies: 1
» Views: 134
Gimp make jpg to Webp 100...
Forum: General questions
Last Post: estatistics
02-24-2025, 09:30 PM
» Replies: 8
» Views: 311

 
  Selction bounding box & shrink radius
Posted by: david - 12-14-2023, 02:25 PM - Forum: Scripting questions - Replies (3)

I have been trying for a couple of days to find the relationship between a selection bounding box and the radius which is used for shrink or grow selection.
My first thoughts were that the radius would be half the diagonal of the bounding box, but this appears not to be true.

In the Shrink/Grow/Feather LIVE PREVIEW GIMP by TinT he has used a binary search routine to find the shrink radius which reduces the selection size to zero in order to set the minimum value for the adjustment slider. However, this is very slow for large images.

I thought that there must be a mathematical formula for the shrink radius that would reduce the size of the smallest bounding box side to half of it's original value.

Help from our resident geniuses greatly appreciated!

david.

Print this item

  Objects not in the layer panel.
Posted by: Whywhywhy - 12-13-2023, 01:49 PM - Forum: General questions - Replies (3)

Hello, I've never had this problem. When I create a new rectangle, it does not generate a layer in the layer panel. I can't select the new object or do anything with it. Does anyone know why? I'd like to attach a screen shot, but the clipboard viewer drives me insane. Any better options there also? Thanks in Advance. J.

Print this item

  Flattening a scanned book
Posted by: antoni gual - 12-13-2023, 10:38 AM - Forum: General questions - Replies (33)

Hello, this is my first post here.
Gimp 2.10.36 in windows 10 here
I'm trying to flatten some warped pages of a hastily scanned book. I have found the filter>distortion > bend along lines (sorry, translated from spanish menus) 
The problem is the book has a funny size of 1300 pixel wide x 3500 pixel tall. With this format, the preview is 1 cm wide in my screen, making the tool unusable. The image does'nt even cover the checkered box, and does'nt change when the dialog is resized.
Is there a way to increase the preview size? Or perhaps is there a tool in gimp more adapted to the job?
Cheers
Antoni

   

Print this item

  Color level adjustment of Layer mask can lead to color distortion - bug ?
Posted by: Grobe - 12-12-2023, 10:10 PM - Forum: General questions - Replies (10)

Hi.

I'm puzzled by an example where level adjustments (extreme settings) can lead to the resulting in color saturation go to maximum.

So my first question: When applying color levels (High input < 6) on a layer mask, is it normal that the resulting output colors can become "scrambled" ?

Second question: Layer mask in general - Is it true that the layer mask can only - for each pixel - set a transparency between 0-100? Or is there exceptions from this that I haven't considered?

Because if the above questions have the answers "No" and then "Yes", then it seems I just found a bug in Gimp.  Can you have a look at this file (original colors in layers and resulting colors after layer mask) and tell me if this output is normal or if I should file a bug.



Attached Files
.xcf   generator-symbol_impossibleColors.xcf (Size: 1,017.46 KB / Downloads: 1000)
Print this item

  Comprehension issue
Posted by: Richie1027 - 12-12-2023, 05:08 PM - Forum: General questions - Replies (4)

Be gentle.   I'm a 70 y/o learning gimp.  have watched 100's of videos and can navigate fairly well, however I have
some cognitive block about layer masks and understanding language such as "white-full opacity" , "black-full transparency", etc.

As seen in the attached pic, I even set up an example similar to what gimp.org had on the layer mask page.  I cannot get my head around
the terminology and what I'm seeing.   The photo on the bottom layer is shows clearly where I painted white, gray and black on the mask.

My brain is telling me that the white layer mask should have covered the photo with a white layer.  

It's a combination of the language thats confusing me, along with the idea of the mask layer.  I mostly understand layers in general, but I'm hoping
someone will help me with a clearer conceptualization of what the "white-full opacity" & "black-full transparency" really mean.   Perhaps substitute another
word or something???

Perhaps is has to do with the idea of a transparent layer actually being a layer and not invisible.    my head is spinning.

hope this is intelligible.  appreciate your suggestions
rich



Attached Files Image(s)
   
Print this item

  trouble with GMIC QT installation (solved)
Posted by: alpheratz - 12-12-2023, 03:38 PM - Forum: Extending the GIMP - No Replies

Since a few releases of both GIMP and GMIC, I have  a recurrent error each time GMIC  is invoked from filters list. The filters are running in the end, but I have to acknoledge many error windows.

Error message  say that "blablabla entry point in xyz dll  is not found". I think after several unsuccessful attempts, Gmic manages to locate and load adequate DLL's .


I think the mess in directory path  is due to several historical version of gimp that are still present on the computer : at install time, GMIC qt is probably fooled and get installed at the wrong place, thus causing subsequent errors.

The work around solution is to seek and uninstall all "fossile" occurence of GIMP and GMIC.  I have used uninstaller of GIMP, and uninstaller also when they where found in gmic directories. After that, I have erased (yes, this is somewhat brutal)  all old directories related to GIMP / GMIC.

I have lost customization settings but it was not critical at that point.  Make simply sure to save your settings (i don't know how to do it) and also the references of your favorite add-ons , so that you can reinstall them.

So far so good, GMIC is accessed flawlessly without any error window popping up.

Print this item

  How to customize current Toolbox? Add/remove tools
Posted by: pstein - 12-10-2023, 12:07 PM - Forum: General questions - Replies (1)

How can I add and remove tools from the current toolbox?

Is it required to setup a new (=my own) toolbox or can I modify the default toolbox (preferred)

Print this item

  TWO windows
Posted by: silverbirch2003 - 12-09-2023, 11:25 PM - Forum: General questions - Replies (6)

Hi
    just  wondering is it  possible  to  get  2  windows  up  ?
Im  thinking of  using  the  clone  tool  and   getting   content  from
one  window   onto   a  pic  on the  other  window  ...

thanks  for  advice or  comments

Print this item

Python Where to find an installed plugin?
Posted by: Krikor - 12-09-2023, 04:05 PM - Forum: Extending the GIMP - Replies (10)

Hey guys,

I installed a plugin to test it but I can't find it anywhere.
I looked inside the Python-Fu menu, I didn't find it.
Also in Filters - Python-Fu, without success.

In fact I'm not even sure what the name of this plugin would be.

Could anyone reveal the location of this plugin? Please!

Below is the plugin code: 

Code:
#!/usr/bin/env python
#grow-shrink-live.py
# Creator: TT
# This should allow user to adjust grow/shrink current selection with live preview
# Open Source
from gimpfu import *
import gtk

# Global variables to store the parameters used for our effect/work to show preview or actual layer when user OK it
global_param1 = 0 #in this example it's shrinkgrow radius
global_param2 = 0   #in this example it's feather_radius
global_param3 = 10  #in this example it's iterations
global_param4 = 0   #in this example it's enhance_shadows

image = 0 #we'll set these when dialog() is called so that we can access them later
drawable = 0
has_preview = False
preview_layer = 0
#for this operation
selection_channel = 0

def apply_effect(layer): #function to do work on either preview layer or actual drawable when user clicks OK
   global image
   radius = global_param1
   feather_radius = global_param2
   pdb.gimp_image_select_item(image,CHANNEL_OP_REPLACE,selection_channel) #first we selected the original saved channel
   if radius < 0:
       pdb.gimp_selection_shrink(image,-radius)
   else:
       pdb.gimp_selection_grow(image,radius)
   pdb.gimp_selection_feather(image,feather_radius)
   #do something to it to show it's effect so that user can distinguish between selected area or not
   pdb.gimp_drawable_edit_fill(layer,FILL_FOREGROUND)

   #pdb.gimp_ellipse_select(image,image.width/2-width/2,image.height/2-height/2,width,height,CHANNEL_OP_REPLACE,TRUE,FALSE,0)
   #pdb.gimp_drawable_invert(layer,TRUE)
   #pdb.gimp_selection_none(image)
   gimp.displays_flush()

def apply_final(layer): #wrapper to apply effect on final and remove preview_layer meant to be called by on_ok_button_clicked
   global preview_layer
   #pdb.gimp_image_undo_group_start(image) #so it's undone in Ctrl+Z
   pdb.gimp_image_undo_enable(image) #so that user can undo this next step
   apply_effect(preview_layer)
   #pdb.gimp_image_undo_group_end(image)
   if has_preview:
       pdb.gimp_image_remove_channel(image,selection_channel) #so that we don't leave a saved channel laying around
       pdb.gimp_image_remove_layer(image,preview_layer)
   pdb.gimp_image_set_active_layer(image,drawable)
   pdb.gimp_context_set_foreground(save_foreground)
   gimp.displays_flush()
 
# Function to update the live preview
def update_live_preview(): #this is called everytime some parameter changes
   global global_param1, global_param2, global_param3, global_param4
   global image,drawable
   global has_preview,preview_layer #deal with preview layer
   global selection_channel #this will save our current selection
   # Apply your plugin's effect using the current parameters
   # Use global_param1 and global_param2 to access the user's inputs
   if not has_preview: #create a preview layer
       #pdb.gimp_message("Creating preview")
       preview_layer = pdb.gimp_layer_new(image,image.width,image.height,RGBA_IMAGE,"preview",70,LAYER_MODE_NORMAL)
       pdb.gimp_image_insert_layer(image,preview_layer,None,0) #insert top most so we see it
       non_empty,x1,y1,x2,y2 = pdb.gimp_selection_bounds(image)
       if non_empty == TRUE:
           pass #there's already a selection
       else:
           pdb.gimp_selection_all(image) #if there's no selection we just select the whole image and work with that  
       selection_channel = pdb.gimp_selection_save(image)
       has_preview = True #now set it true so we can deal with existing layer in later calls
   else: # already have preview layer
       pass
       #pdb.gimp_message("Removing existing and creating new Preview")
       pdb.gimp_image_remove_layer(image,preview_layer) #remove it to create a new one to work on
       preview_layer = pdb.gimp_layer_new(image,image.width,image.height,RGBA_IMAGE,"preview",50,LAYER_MODE_NORMAL)
       pdb.gimp_image_insert_layer(image,preview_layer,None,0) #insert top most so we see it
   pdb.gimp_image_set_active_layer(image,preview_layer)
   #debug message
   #pdb.gimp_message(str(global_param1)+","+str(global_param2)+","+str(global_param3)+","+str(global_param4))

   apply_effect(preview_layer)
 
   # Update the live preview layer with the modified image
 
save_foreground = 0
hilightcolor = (255,0,0)
def dialog(image_, drawable_):
   global image, drawable, save_foreground
   #save these for updates
   image = image_
   pdb.gimp_image_undo_disable(image) #for speed and also when user undo it doesn't see our preview creations/deletions
   drawable = drawable_
   save_foreground = pdb.gimp_context_get_foreground()
   pdb.gimp_context_set_foreground(hilightcolor)

   dialog = gtk.Dialog("Shrink/Grow Feather Selection Live Preview", None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
   dialog.set_default_size(600, 100)

   # Create an HBox to hold the label and slider -------------------------------------------------------------
   hbox = gtk.HBox()
   dialog.vbox.pack_start(hbox, expand=True, fill=True)

   # Create a label on the left-hand side
   label1 = gtk.Label("Shrink/Grow Radius:")
   hbox.pack_start(label1, expand=False, fill=False, padding=5)

   # Create an adjustment for the HScale (slider) with a range from 10 to 90
   adjustment1 = gtk.Adjustment(value=0, lower=-400, upper=400, step_incr=1, page_incr=0)
   param1_scale = gtk.HScale(adjustment=adjustment1)
   param1_scale.set_digits(0)  # Display only integers
   hbox.pack_start(param1_scale, expand=True, fill=True, padding=5)
   # Connect callback functions for user interaction
   param1_scale.connect("value-changed", on_param1_changed)

   # # Create an HBox to hold the label and slider -------------------------------------------------------------
   hbox2 = gtk.HBox()
   dialog.vbox.pack_start(hbox2, expand=True, fill=True)

   # Create a label on the left-hand side
   label2 = gtk.Label("Feather Radius:")
   hbox2.pack_start(label2, expand=False, fill=False, padding=5)

   # Create an adjustment for the HScale (slider) with a range from 10 to 90
   adjustment2 = gtk.Adjustment(value=0, lower=0, upper=400, step_incr=1, page_incr=0)
   param2_scale = gtk.HScale(adjustment=adjustment2)
   param2_scale.set_digits(0)  # Display only integers
   hbox2.pack_start(param2_scale, expand=True, fill=True, padding=5)
   # Connect callback functions for user interaction
   param2_scale.connect("value-changed", on_param2_changed)

   # # Create an HBox to hold the label and slider -------------------------------------------------------------
   # hbox3 = gtk.HBox()
   # dialog.vbox.pack_start(hbox3, expand=True, fill=True)

   # # Create a label on the left-hand side
   # label3 = gtk.Label("iterations:")
   # hbox3.pack_start(label3, expand=False, fill=False, padding=5)

   # # Create an adjustment for the HScale (slider) with a range from 10 to 90
   # adjustment3 = gtk.Adjustment(value=10, lower=1, upper=30, step_incr=1, page_incr=0)
   # param3_scale = gtk.HScale(adjustment=adjustment3)
   # param3_scale.set_digits(0)  # Display only integers
   # hbox3.pack_start(param3_scale, expand=True, fill=True, padding=5)
   # # Connect callback functions for user interaction
   # param3_scale.connect("value-changed", on_param3_changed)

   # Add an OK button
   ok_button = dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
   ok_button.connect("clicked", on_ok_button_clicked)
   # Show the dialog
   dialog.show_all()
   update_live_preview() #call this once so we see effect
   dialog.run()
 

# Callback function for updating the live preview when param1 changes
def on_param1_changed(scale):
   global global_param1
   global_param1 = scale.get_value()
   update_live_preview()

# Callback function for updating the live preview when param2 changes
def on_param2_changed(scale):
   global global_param2
   global_param2 = scale.get_value()
   update_live_preview()

def on_param3_changed(scale):
   global global_param3
   global_param3 = scale.get_value()
   update_live_preview()

# Callback function for the OK button
def on_ok_button_clicked(button, data=None):
   global drawable
   apply_final(preview_layer) #preview layer because we don't want to apply the invert to final layer it's just for viewing
   button.get_toplevel().destroy() #destroys the gtk dialog window
# Register the Python-Fu plugin
register(
   "python_fu_grow_shrink_live",
   "Grow/Shrink Current Selection with Live Preview",
   "Grow/Shrink Current Selection with Live Preview",
   "TT",
   "TT",
   "NAME",
   "<Image>/Python-Fu/Live Preview/Grow-Shrink Live",  # Menu location
   "*",  # Image type
   [],
   [],
   dialog
)

main()


Thx.

Print this item

  Pen tools not working
Posted by: Stephen Liu - 12-09-2023, 02:07 PM - Forum: General questions - Replies (11)

Hi all,

GIMP version 2.10.30
OS - Ubuntu 22.04.3 LTS desktop

My Pen Tools are not working.  Please advise whehter to check and how to fix the problem.

Thanks

Regards

Print this item