It is currently Mon Aug 10, 2026 10:30 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Embroider Stitcher for Gimp-3.0
PostPosted: Wed Mar 26, 2025 4:52 am  (#1) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16153
GIMP Version: 3.0.3
Operating System: Windows
OS Version: Windows 10
GIMP Experience: Experienced User

List any relevant plug-ins or scripts:
GEGL-NOISE-SPREAD

List any ERROR messages you received:
Execution error for 'Embroidery-Stitcher':
Error: Procedure execution of gimp-drawable-filter-new failed on invalid input arguments: drawable_filter_new_invoker: the filter "gegl-spread" is not installed.




Here is what i have so far but i get this error. I cannot figure out how to invoke the GEGL noise spread plug-in.
Execution error for 'Embroidery-Stitcher':
Error: Procedure execution of gimp-drawable-filter-new failed on invalid input arguments: drawable_filter_new_invoker: the filter "gegl-spread" is not installed.




;;; Plugin  : Embroidery Stitcher
;;; Author  : Rod Detmer
;;; Date    : August 1st 2012
;;; Revision: Gimp-3.0
;;;                
;;; Version : 1.0
;;; Latest version at: http://www.gimpchat.com/viewtopic.php?f=9&t=4858&p=60447#p60447
;;; Required : Gimp 3.0 or later
;;;
;;; Description:
;;; Creates an embroidery effect on your Image
;;; -----------------------------------------------------------------------------
;;;
;;; License:
;;; 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., 675 Mass Ave, Cambridge, MA 02139, USA.

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

(define (script-fu-embroidery-stitcher image drawable)
  (gimp-context-push)
  (gimp-image-undo-group-start image)

              (let* ((emlayer (car (gimp-layer-new-from-visible image image "Embroided layer"))))
                  ;copy the image to a new layer and name it
                (gimp-image-insert-layer image emlayer 0 0)
            (gimp-layer-copy emlayer)
            


;Get the first layer of the first image
  (gimp-get-images)
  (gimp-image-get-layer-by-name image "Embroided layer")

;Create filter
  (gimp-drawable-filter-new emlayer "gegl-spread")

;Set properties
  (filter-config-set-property ("horizontal"  7))
  (filter-config-set-property ("vertical" 7))
; (filter-config-set-property ("random seed" 0))
  (filter-config-set-property ("mode" 62)) 
  ;(filter-config-set-property ("opacity" 100))
; (filter-config-set-property ("preview" 1)) 
; (filter-config-set-property ("merge filter" 0))
; (filter-config-set-property ("split view" 0)) 

;Apply filter
  (layer-merge-filter (filter))


;Get the first layer of the first image
  (gimp-get-images)
  (gimp-image-get-layer-by-name image "Embroided layer")

;Create filter
  (gimp-drawable-filter-new emlayer gegl neon)

;Set properties
  (filter-config-set-property ("radious"  4.081))
  (filter-config-set-property ("intensity" 0.080))
  (filter-config-set-property ("mode" 62)) 
;(filter-config-set-property ("opacity" 100))
;(filter-config-set-property ("preview" 1)) 
; (filter-config-set-property ("merge filter" 0))
; (filter-config-set-property ("split view" 0)) 
;Apply filter
  (layer-merge-filter (filter))

;Get the first layer of the first image
  (gimp-get-images)
  (gimp-image-get-layer-by-name image "Embroided layer")

;Create filter
  (gimp-drawable-filter-new emlayer gegl brightness-contrast)

;Set properties
  (filter-config-set-property ("brightness"  0))
  (filter-config-set-property ("contrast" contrast))
  ;(filter-config-set-property ("edit these settings as levels" 0))
  ;(filter-config-set-property ("mode" 62)) 
  ;(filter-config-set-property ("opacity" 100))
  ;(filter-config-set-property ("preview" 1)) 
  ;(filter-config-set-property ("merge filter" 0))
; (filter-config-set-property ("split view" 0))   

;Apply filter
;(layer-merge-filter (filter))



  (gimp-layer-set-mode "Embroided layer" LAYER-MODE-HSV-VALUE-LEGACY)
 
;set opacity for Embroided layer
  (gimp-layer-set-opacity "Embroided layer" 90)
 
;display the new image
  (gimp-displays-flush image)
  (gimp-context-pop)
  (gimp-image-undo-group-end image)
             )
 
)


(script-fu-register "script-fu-embroidery-stitcher"
"Embroidery-Stitcher"
"creates an embroidery effect and using more colors result in better outcome"
"Rod Detmer"
"Rod Detmer"
"August 2012"
"RGB* GRAY*"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Drawable" 0
SF-ADJUSTMENT "Contrast" '(127 0 127 1 10 0 SF-Spinner)
)

(script-fu-menu-register "script-fu-embroidery-stitcher" "<Image>/Rod/Artistic")

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Wed Mar 26, 2025 5:36 am  (#2) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16153
gimp-drawable-filter-new takes 3 params

The drawable
The GEGL operations name
The effect name

So this is how i wrote it out
(gimp-drawable-filter-new emlayer "noise spread")

And got this error
Execution error for 'Embroidery-Stitcher':
Error: Procedure execution of gimp-drawable-filter-new failed on invalid input arguments: drawable_filter_new_invoker: the filter "noise spread" is not installed.

Does anyone know the name of the plug-in for spread?

_________________
Image


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Wed Mar 26, 2025 6:44 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2648
Location: Poland
Hi Rod.

I would take a look and take a hint from script-fu that uses Gegl in Gimp 3.
For example difference-clouds.scm uses "gegl:noise-solid".

_________________
Image


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Wed Mar 26, 2025 7:18 am  (#4) 
Offline
GimpChat Member

Joined: Dec 28, 2023
Posts: 67
Rod: From https://gegl.org/operations/gegl-noise-spread.html, it looks like you would use "gegl:noise-spread" for the filter operation.


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Wed Mar 26, 2025 3:24 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Dec 09, 2018
Posts: 736
This works for me in gimp 3.0.0:

    (gimp-drawable-merge-new-filter drawable "gegl:noise-spread" 0 LAYER-MODE-REPLACE 1.0
        "amount-x" 5 "amount-y" 5 "seed" 0)

I'm finding gimp-drawable-filter-new works OK but that gimp-drawable-filter-get-config isn't available in gimp 3.0.0.
Anyway gimp-drawable-merge-new-filter seems easier of you want to merge the filter.


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Thu Mar 27, 2025 2:10 am  (#6) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16153
Thanks for your help everyone. :) That link to the gegl operations helped immensely.

So what i understand is that you have to create (add) the filter then merge it to the layer like so?

;Create filter and merge filter with set properties
(gimp-drawable-filter-new emlayer "gegl:noise-spread")
(gimp-drawable-merge-new-filter emlayer "gegl:noise-spread" 0 LAYER-MODE-REPLACE 1.0
        "amount-x" 7 "amount-y" 7 "seed" 0)


I believe you can also append the filter to add as an adjustable fx layer. :bigthup

_________________
Image


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Thu Mar 27, 2025 2:42 am  (#7) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16153
MareroQ wrote:
Hi Rod.

I would take a look and take a hint from script-fu that uses Gegl in Gimp 3.
For example difference-clouds.scm uses "gegl:noise-solid".


Thx MareroQ. Can you tell me where to find the difference-clouds.scm file for 3.0?

_________________
Image


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Thu Mar 27, 2025 2:55 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2648
Location: Poland
C:\Program Files\GIMP 3\share\gimp\3.0\scripts\

_________________
Image


Top
 Post subject: Re: Embroider Stitcher for Gimp-3.0
PostPosted: Thu Mar 27, 2025 3:11 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Dec 09, 2018
Posts: 736
Rod wrote:
So what i understand is that you have to create (add) the filter then merge it to the layer like so?

;Create filter and merge filter with set properties
(gimp-drawable-filter-new emlayer "gegl:noise-spread")
(gimp-drawable-merge-new-filter emlayer "gegl:noise-spread" 0 LAYER-MODE-REPLACE 1.0
        "amount-x" 7 "amount-y" 7 "seed" 0)

Assuming you are coding in scheme and that you want to merge the filter you just do the gimp-drawable-merge-new-filter.
gimp-drawable-merge-new-filter is a a short hand for doing the new, setting the arguments and merging so when using it you don't need to do the gimp-drawable-filter-new.


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group