Post Reply 

how do I pre-apply filters?

Jul 19, 2013, 08:47
Post: #16
RE: how do I pre-apply filters?
Firstly I recommend having the Error console open, because then you will see this error when you try and run your code:
Code:
Error while executing batch-oilify-mask:

Error: eval: unbound variable: INT32

As offnuts already said, you need to change your line:
Code:
(plug-in-oilify RUN-NONINTERACTIVE image drawable INT32 { RGB (0), INTENSITY (1) })
to :
Code:
(plug-in-oilify RUN-NONINTERACTIVE image drawable mask_size mode )

And because I like to make things easy for myself I always make a menu entry for batch scripts so I can try them out quicker:

Code:
(define (batch-oilify-mask pattern mask_size mode)
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
      (let* (
              (filename (car filelist))
              (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
              (drawable (car (gimp-image-get-active-layer image)))
            )
;            (plug-in-oilify RUN-NONINTERACTIVE image drawable INT32 { RGB (0), INTENSITY (1) })
            (plug-in-oilify RUN-NONINTERACTIVE image drawable mask_size mode)
            (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
            (gimp-image-delete image)
      )
      (set! filelist (cdr filelist))
    )
  )
)

(script-fu-register "batch-oilify-mask"
            _"<Image>/contributed/Interactive Batch Oilify..."
            "Interactive front end to batch oilify"
            "I did this"
            "GPL License"
            "19/07/2013"
            "*"
                    SF-STRING   _"Pattern" "*.png"
            SF-ADJUSTMENT _"Mask Size" '(7 1 3872 1 10 0 1)
            SF-ADJUSTMENT _"Mode" '(1 1 3872 1 10 0 1)
)

I hope you're trying to run this on copies of your originals because it will replace anything it finds with an "oilified" version.

Kevin
Find all posts by this user
Quote this message in a reply
Jul 19, 2013, 23:22 (This post was last modified: Jul 21, 2013 23:34 by chicortiz.)
Post: #17
RE: how do I pre-apply filters?
(Jul 19, 2013 07:19)ofnuts Wrote:  My dedication won't replace a two-years university cursus in programming Smile

Im sorry but now, you are wrong.

I did it after all! And I found the right answer because of the keywords you gently shared with everyone. Smile

Look the right script is this one:

batch-oilify.scm

' Wrote:(define (batch-oilify-mask pattern mask_size mode)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE
filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(plug-in-oilify RUN-NONINTERACTIVE image drawable mask_size mode)
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))

I copied the scm script inside two folders of GIMP, MacOsx version 2.8.4:

1)
/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/scripts

2)
/Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/plug-ins

I moved my folder filled with .png pictures to the "/" directory.

So the final command, using the script fu console is:

(batch-oilify-mask "/test/*.png" 7 1)

Thank you very much for your help. I hope to post an animation sample pretty soon demonstrating the effect Smile

###

Edit: Lol I posted the reply while paynekj was writing his post too! Thank you paynekj!

Many thanks to Yorik Van Havre too for testing this procedure in Linux, which led me to the right solution inside MacOSX.
Find all posts by this user
Quote this message in a reply
Jul 21, 2013, 22:23 (This post was last modified: Jul 21, 2013 23:35 by chicortiz.)
Post: #18
RE: how do I pre-apply filters?
As I promised, just a tiny sample illustrating what can be done. I over exaggerated the effect to make it more visible because as you know, the palette is more restrict on .gifs ; )

[Image: Edge3.gif]

Thank you very much Gimp community,

Ortiz
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to apply Lighting Effects for entire image Graphicman2014 3 296 Aug 21, 2014 23:24
Last Post: Graphicman2014
  How to apply text to each individual layer? Corey88 4 872 Nov 18, 2011 10:27
Last Post: rich2005
  Convert for Smart Filters and other Photoshop stuff sja785 2 2,878 Aug 11, 2011 15:28
Last Post: sja785

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS