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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,998
» Latest member: Phacartoon
» Forum threads: 7,411
» Forum posts: 40,337

Full Statistics

Latest Threads
No keyboard shortcuts—all...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
1 hour ago
» Replies: 1
» Views: 64
Forced to operate Gimp 3....
Forum: Gimp 2.99 & Gimp 3.0
Last Post: Ofnuts
11 hours ago
» Replies: 2
» Views: 221
ofn3-layer-tiles
Forum: Extending the GIMP
Last Post: Ofnuts
11 hours ago
» Replies: 8
» Views: 1,111
ofn-flatten-cylinder
Forum: Extending the GIMP
Last Post: Ofnuts
11 hours ago
» Replies: 13
» Views: 5,279
New Install, Black Screen...
Forum: OSX
Last Post: Indeterminate
Yesterday, 07:14 PM
» Replies: 2
» Views: 130
How to change default Win...
Forum: General questions
Last Post: oatmeal769
Yesterday, 05:35 PM
» Replies: 2
» Views: 116
Gimp doesn't recognize mo...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
Yesterday, 03:27 PM
» Replies: 2
» Views: 98
Black brush shows milky e...
Forum: General questions
Last Post: rich2005
Yesterday, 03:13 PM
» Replies: 1
» Views: 73
Change of operation of th...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: brianleach
Yesterday, 02:15 PM
» Replies: 4
» Views: 98
Créer des bords noirs sur...
Forum: General questions
Last Post: Ethan Burke
Yesterday, 09:26 AM
» Replies: 2
» Views: 194

 
  Unable to find or use script I created
Posted by: Desicub99 - 03-03-2025, 10:18 PM - Forum: Extending the GIMP - Replies (4)

I developed this script:
(define (script-fu-red-rectangle-with-borders)
  (let* (
        (width 640)
        (height 400)
        (rect-width 625)
        (rect-height 385)
        (border-size 19)
        (black-border 5)
        (image (car (gimp-image-new width height RGB)))
        (bg-layer (car (gimp-layer-new image width height RGBA-IMAGE "Background" 100 NORMAL)))
        (rect-layer (car (gimp-layer-new image width height RGBA-IMAGE "Red Rectangle" 100 NORMAL)))
        (border-layer (car (gimp-layer-new image width height RGBA-IMAGE "White Border" 100 NORMAL)))
        (black-border-layer (car (gimp-layer-new image width height RGBA-IMAGE "Black Border" 100 NORMAL)))
        )

    ;; Add layers to image
    (gimp-image-insert-layer image bg-layer 0 -1)
    (gimp-image-insert-layer image rect-layer 0 -1)
    (gimp-image-insert-layer image border-layer 0 -1)
    (gimp-image-insert-layer image black-border-layer 0 -1)

    ;; Set transparency background
    (gimp-context-set-background '(0 0 0 0))
    (gimp-drawable-fill bg-layer TRANSPARENT-FILL)

    ;; Select centered rectangle
    (gimp-rect-select image
                      (/ (- width rect-width) 2)  ;; X Position
                      (/ (- height rect-height) 2) ;; Y Position
                      rect-width rect-height
                      REPLACE)

    ;; Fill rectangle with mesh pattern
    (gimp-context-set-pattern "Mesh") ;; Ensure GIMP has a mesh pattern
    (gimp-edit-bucket-fill rect-layer PATTERN-FILL NORMAL 100 0 FALSE 0 0)

    ;; Stroke red border
    (gimp-context-set-foreground '(255 0 0))  ;; Set color to red
    (gimp-edit-stroke rect-layer)

    ;; Expand selection for white border
    (gimp-selection-border image border-size)

    ;; Fill border with white
    (gimp-context-set-foreground '(255 255 255))  ;; White color
    (gimp-edit-bucket-fill border-layer FG-BUCKET-FILL NORMAL 100 0 FALSE 0 0)

    ;; Deselect
    (gimp-selection-none image)

    ;; Select entire canvas for black border
    (gimp-selection-all image)

    ;; Stroke black border
    (gimp-context-set-foreground '(0 0 0))  ;; Black color
    (gimp-edit-stroke black-border-layer)

    ;; Display image
    (gimp-display-new image)
    (gimp-image-undo-group-end image)
  ))

;; Register the script in GIMP
(script-fu-register
  "script-fu-red-rectangle-with-borders"   ;; Internal script name
  "Red Rectangle with Borders"             ;; Menu name (what you see in GIMP)
  "Creates a red rectangle with a mesh pattern and white/black borders"
  "Your Name"
  "Your Name"
  "2025"
  "*"
  ""
  "script-fu-red-rectangle-with-borders")  ;; Function to execute
  and have tried several ways to use it. 
  
  First I saved it in:
  C:\Users\username\AppData\Roaming\GIMP\2.10\scripts\red-rectangle-with-borders.scm
  I tried filters -> Script-FU -> Refresh Script and clicked on filters -> Script-FU and the file wasn't there.  I closed Gimp and reopened it. 
  Then I I looked in help -> Plug-in browser and couldn't find it there. 
  I looked in all of the menus since I read that the scm file could be anywhere but no luck.
  
  So I saved it in downloads and  moved it to this path: 
C:\Program Files\GIMP 2\share\gimp\2.0\scripts\red-rectangle-with-borders.scm  
 I did the same things that I did when I saved it in the roaming folder and still no luck.

Would someone be gracious enough to show me what I did wrong?  Thanks

Print this item

  ConvertComic to PDF via bash in Linux
Posted by: vitforlinux - 03-03-2025, 01:15 PM - Forum: Other graphics software - Replies (2)

Yesterday I wanted to change the subject a bit and I fished out an old script of mine to convert the CBR (rar) and CBZ (zip) Comics Books files to PDF on bash using Linux.

I could probably add the CBT (tar) and CB7 (7zip) formats, but I can't find sample files for the tests.

The repo is located here:
https://github.com/vitforlinux-gimp/convertcomic

Print this item

  Troubles with porting a script to Gimp3
Posted by: alvk - 03-03-2025, 10:42 AM - Forum: Scripting questions - Replies (23)

Hello!

I have trouble with porting a script written in Script-Fu from Gimp2 to Gimp3. I managed to run the script, but when script execution finished, I've got the following error: argument 1 must be: number. Unfortunately, I cannot understand why this error occurs. Could anyone review my code and help me to make the script working. The script is below:

Code:
#!/usr/bin/env gimp-script-fu-interpreter-3.0

; Adds labels to a layer
; Works with Gimp v.3

(define (script-fu-add-labels image drawables user-text font font-size
                              font-color x y outline-toggle outline-color
                              outline-thickness)

 (let* ((current-layer (vector-ref drawables 0))
        (off-x (car (gimp-drawable-get-offsets current-layer)))
        (off-y (cadr (gimp-drawable-get-offsets current-layer)))

        (text-layer)
        (text-layer-position-x (+ off-x x))
        (text-layer-position-y (+ off-y y))
        (text-layer-outline)
        (text-layer-vectors)
        (text-layer-group)
        (text-layer-group-name)
        (text-foreground-color-old)

        (parent-layer-type 0)
        (parent-layer-name)
        (parent-layer-group (car (gimp-item-get-parent current-layer)))

        (old-background (car (gimp-context-get-background))))

   (cond ((= #t (car (gimp-item-id-is-channel current-layer))) (set! layer-type 1))
         ((= #t (car (gimp-item-is-group current-layer))) (set! layer-type 1))
         ((= #t (car (gimp-item-id-is-layer-mask current-layer))) (set! layer-type 1))
         ((= #t (car (gimp-item-id-is-selection current-layer))) (set! layer-type 1))
         ((= #t (car (gimp-item-id-is-text-layer current-layer))) (set! layer-type 1)))

   (gimp-image-undo-group-start image)

   (if (= 1 parent-layer-type)
     (begin
       (set! parent-layer-name (car (gimp-item-get-name current-layer)))
       (gimp-message
         (string-append "Cannont add the label to the layer " parent-layer-name)))
     (begin
       (set! text-layer (car (gimp-text-font image -1 text-layer-position-x
                                                 text-layer-position-y user-text 2 #t
                                                 font-size POINTS font)))
       (gimp-text-layer-set-color text-layer font-color)
       (when (= outline-toggle #t)
         (set! text-layer-group (car (gimp-layer-group-new image)))
         (set! text-layer-group-name
           (string-append "Text_" (car (gimp-text-layer-get-text
                                         text-layer))))
         (set! text-layer-vectors (car (gimp-vectors-new-from-text-layer image
                                                                         text-layer)))
         (set! text-layer-outline (car (gimp-layer-copy text-layer #t)))
         (set! text-foreground-color-old (car (gimp-context-get-foreground)))
         (gimp-item-set-name text-layer-group text-layer-group-name)
         (gimp-image-insert-layer image text-layer-group 0 0)
         (gimp-image-insert-vectors image text-layer-vectors 0 -1)
         (gimp-image-reorder-item image text-layer text-layer-group 0)
         (gimp-image-insert-layer image text-layer-outline text-layer-group -1)
         (gimp-context-set-foreground outline-color)
         (gimp-context-set-stroke-method 0)
         (gimp-context-set-line-width outline-thickness)
         (gimp-drawable-edit-stroke-item text-layer-outline text-layer-vectors)
         (gimp-context-set-foreground text-foreground-color-old)
         (gimp-item-set-expanded text-layer-group #f)
         (gimp-item-set-lock-position text-layer-outline #t))
       (gimp-item-set-lock-position text-layer #t)))

   (gimp-displays-flush)
   (gimp-image-undo-group-end image)))

(script-fu-register-filter "script-fu-add-labels"
                   _"Add labels"
                   _""
                   ""
                   ""
                   ""
                   "*"
                   SF-ONE-OR-MORE-DRAWABLE
                   SF-STRING        _"Label" "A"
                   SF-FONT        _"Font" "Arial Bold"
                   SF-ADJUSTMENT _"Font size"         (list 50 5 100 1 10 0 1)
                   SF-COLOR _"Font color"          (list 0 0 0)
                   SF-ADJUSTMENT _"Offset X"         (list 6 0 500 1 10 0 1)
                   SF-ADJUSTMENT _"Offset Y"         (list 6 0 500 1 10 0 1)
                   SF-TOGGLE _"Outline" #f
                   SF-COLOR _"Outline color"          (list 255 255 255)
                   SF-ADJUSTMENT _"Outline thickness"         (list 1 0 5 1 1 0 1)
                   )

(script-fu-menu-register "script-fu-add-labels"
                        "<Image>/Figures")

Print this item

  Getting emotional with my favorite brand of machines
Posted by: Ofnuts - 03-02-2025, 08:50 PM - Forum: Gallery - Replies (6)

   

Actually trying my hand with Darktable. Just discovered that it can export directly to XCF 32-bit FP format.

Most of the work (exposure/tone/perspective) done in DT. Gimp used to lighten up the red dot (which could possibly be done in DT once I know it better) and clean out a few dust specks.

Print this item

  printing issue, please help
Posted by: bringoutthegimp! - 03-02-2025, 07:09 PM - Forum: General questions - Replies (11)

I've recently embarked on digitizing a number of b&w negatives, which I have scanned using VueScan. I'm now at the point of editing them slightly using Gimp (v 3.0), which has gone fairly well, after climbing the learning curve.

I now want to print them. To do so, I'm first selecting the Image-->Print Size, and selecting (for example) a width (7.0) and and height (4.692), which results in a PPI of 1303 in my case. From there, I'm simply selecting the "Print" option in Gimp and sending the job to the printer (Canon Pixma-100). In the Print dialog, the same sizes and ppi values are reflected (7 x 4.692, 1303). I'm using A3+ paper (I know, it's oversized, but it's what I have at the moment). I used to have the printer installed on a former computer, but that was years ago. This time around, rather than use the installation disks and their bloatware I merely downloaded the current printer driver from Canon's site.

When I print the photo at 300x300 dpi it prints very small on the paper (~3.5" x 2.25"). When I print at 600x600 dpi it seems to prints at the correct dimensions (~7" x 4.7"). When I print at 1200x1200 dpi it prints only a small portion of the image (very large), since the majority of the image would appear off of the page. In each case, it would seem that the image should actually print at 7.0" x 4.692" since that is what I selected...yet, these different sizes are the result. It appears that the DPI setting selected in the Gimp Print option is dictating the image size, rather than the Print Size that I have selected for the file.

I recognize that it might be the case that the printer driver is overriding the Print Size. When I select the printer via my Mac (System Settings-->Printers and Scanners-->Canon Pro 100 Series) there is no option anywhere to un/check a "Fit to Page" or "Scale to Fit" option, which I thought might be the issue.

Does anyone know how I can get images to print at the size I've selected, given my current setup?

Thanks in advance for any help or ideas, I appreciate it.

Print this item

  How to combine a video that has green screen with a background image
Posted by: mariah701 - 03-02-2025, 05:13 PM - Forum: General questions - Replies (3)

How do I combine this image with this video, so the green screen removed into and the image as the background instead
anyone know, I been trying and my brain still cant process it
[img][Image: fgrjkrnghkjeg.jpg][/img]

https://imgur.com/a/Ci93Hux

Print this item

  Import issues
Posted by: mthoughdesigns - 03-02-2025, 12:52 AM - Forum: General questions - Replies (1)

I've recently had to reinstall GIMP on a fresh boot of my computer. When I important images that are larger than the canvas (i.e. I am working in layers and want to add something then resize) GIMP is automatically adding rows of dead pixels to the image. These images are seamless and do not have dead pixels/seams in the original. I have verified there are no additional pixels in the original image by opening it on its own, transforming it, and zooming in.

Does anyone know how to fix this? 

Thank you.

Print this item

  Can't get a clean Select by color background
Posted by: rdoty - 03-02-2025, 12:32 AM - Forum: General questions - Replies (5)

I've got several photos of items (lots of white with color images) that are taken with a backdrop.  I want to make the background transparent.  Initially I used a white backdrop which was marginal.  Then I switched to a light blue which wasn't much better.  Finally I changed to a dark Navy blue background and I figured the high contrast would be ideal.  Unfortunately I can't get rid of the background compleltely.
   My first attempt was with Fuzzy Select and when I clicked on the background it turned the entire image red.  Playing with all the settings (anti alias, draw mask, alpha channel) I just couldn't get it to work.  Never could get the Feather to activate.  So then I switched to Select by Color and that worked - mostly.  The problem is that the backdrop, which is a solid color, has some minor undulations which cause slight variations in color density.  The result is that some of these variations leave a shimmering effect which when saved aren't completely transparent.  There's still lots of contrast between the image and background so that baffles me.  I'm using Inkscape as the graphics editor and I'm a real amateur with Gimp so I could use come help.

Print this item

  Transition to Gimp 3
Posted by: Ciobi - 03-01-2025, 03:52 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (3)

Hi,

I've been using Gimp since 1996 for various purposes, but in recent years it's mostly for processing screenshots - capturing, combining, drawing arrows or text on them. In 2000 I bought Grokking the Gimp, and a lot of what was there still applies to the latest Gimp 2.

All was generally fine until a year ago, when I could no longer take screenshots because my Linux distribution moved to Wayland. I had the workaround of using a different tool and copying the result to Gimp.

With the move to Gimp 3, things got significantly worse. For one thing, now I also cannot scan images, because the xsane driver that worked with Gimp 2 is 8 years old and nobody maintains it (though there seem to be some workaround, but I didn't really need it, so I didn't check).

But the reason I'm writing this is that I cannot figure how to use the rectangular selection effectively. In the good old days, you could select a rectangle and copy it, and when you pasted it, you'd have a rectangle with whatever you copied on a temporary layer and that was that. Then you could move this temporary layer and change its opacity (which helped me align images) and then you'd choose to either transform the temporary layer into a new, real layer or "anchor" it to the leer below. Now when I paste it's not just my selection (because it's surrounded by transparency so the new layer is the exact size of the layer I copied from) and I need to keep switching between the Select and Move tools, because there is no longer a temporary layer. It also makes Fit Canvas to layers pretty pointless to me, as my layers are way too big (unless I use the crop tool, which I didn't need until now).

I couldn't find anything relevant in the manual or using the search engines and when I ask the AIs they either tell me that nothing changed regarding selection in Gimp 3, or that I must use the crop tool or other things that take more time than the equivalent Gimp 2 ways. Still, I can't imagine being the only one facing these issues, so I wonder if there is some guide describing the Gimp 3 equivalents of the basic Gimp 2 features.

Thank you!

Print this item

  A reasoning on what you can do with scm on gimp 3.0
Posted by: vitforlinux - 03-01-2025, 01:02 PM - Forum: Gimp 2.99 & Gimp 3.0 - Replies (8)

If script-fu are placed in the "scripts" folder, they have a habitual and predictable behavior.

If I modify them and put them in "plugins" they have another one, changes must be added on purpose and sometimes you don't understand the mistake.

BUT if I put them in "plugins" Gimp 3.0 official appimage overcomes some problems that crash the script engine.

Now comes the problem, exactly like to be or not to be, I have to continue to use the "scripts" folder, or I have to arm myself and solve the problems it causes by moving them to "plugins".

I wouldn't want my "to be or not to be" to be Mel Brooks' film.

Print this item