It is currently Sun Nov 15, 2026 3:09 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 17 posts ] 
Author Message
 Post subject: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 4:07 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
GIMP Version: 2.7.2
Operating System: Windows
OS Version: XP - SP3
GIMP Experience: Beginner Level



Hi,

When I install new scripts in GIMP 2.7.2 i can't see them even after re-opening the program.

I am interested in layerfx.scm

Any help, please?

joseph


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: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 5:44 am  (#2) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
I suspect the problem is down to how you have "installed" the script.

What exactly did you do to install it, specifically where did you put the .scm file?

Kevin


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 9:18 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
Hi,

I put them into the following directory:

C:\Program Files\gimp-2.7.2\share\gimp\2.0\scripts


Image


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 9:36 am  (#4) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
OK, that's not the best place, but it should work.

Can you confirm that you put individual .scm files into that folder and NOT a zip file.
Also in Gimp select Edit->Preferences and have a look at the folders section - specifically for the scripts.
Does the folder you detailed appear in the list?

Oh and where did you get the scripts from? I ask because layerfx.scm isn't one I have so I can't tell you where it will appear in Gimp's menus.


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 12:40 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
Hi,

I downloaded the scripts from Gimp scripts from www.registry.gimp.org
Some are downloaded as .scm but some have to be unziped, which i did

I can see the folder through the preferences

What would be the best place to install the scripts?

Just confused i guess.

:hoh


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 1:32 pm  (#6) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5243
Location: Gimpville
Just a reminder that there are pinned threads at the top of the Gimp Help forum with some basic script/plug-in install instructions, as well as the recommended folder locations for installed scripts.

viewforum.php?f=8

_________________
"If Microsoft ever does applications for Linux it means I've won." - Linus Torvalds


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 2:39 pm  (#7) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16270
LayerFX should appear in a new separate menu item "Script-Fu" in the image window menu bar.

Image


Are you sure you are saving them with a SCM extension and not a TXT extension?

_________________
Image


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Mon Apr 11, 2011 8:39 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
IIRC, when you save in windows you have to be careful or microsoft will add the txt extension on to the .scm ie, script.scm.txt. I think you have to make sure you have "all files" selected when you save or that will happen. And on my old pc, which was XP SP3, I put my scripts exactly where you have put yours and they worked perfect...after I learned how NOT to have the .txt extension.


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Tue Apr 12, 2011 12:42 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
All my scripts have the extension .scm. I made sure if they were provided in text format I had to replace the .txt with .scm and save as type "All"

Maybe my GIMP is corrupt, but seem to me working well. I might have to download a fresh copy.

Thanx to all.


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Tue Apr 12, 2011 2:19 am  (#10) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16270
I dont think its Gimp try this -
Right click the script
Select properties
At the bottom of the window check to see if you need to un-block it.
That is sort of a way Windows CHMODS it's files.
I do have to do this quite a lot with SCM and Python files.

_________________
Image


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Tue Apr 12, 2011 2:34 am  (#11) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
josephbupe wrote:
When I install new scripts in GIMP 2.7.2 i can't see them even after re-opening the program.

I am interested in layerfx.scm

Any help, please?


Maybe with gimp 2.7.2 the python version of that script could be better because offer also a sort of preview

Anyway it is possible that you didn't found the script only because you didn't know where to look ?

because there is no way to predict where a script will be installed , except if looking to the script
BUT that is easy and don't require know any coding, because is all in a line always written in plane english and always very close to the end of the script

let see where i chose a script i open with the notepad ( In Win better Notepad++ then the basic notepad )

Don't get scared you only need to look at what close to the end, here in big bold and red

;#######################################
; roys-max-local-contrast, a Gimp script by Roy Johnson
;
; Create New From Visible
; Desaturate using Luminance
; Create two new copies, one called Min and one Max
; For each gray value, 0 to 255:
; color-select from the desaturated image
; grow selection by Radius parameter and feather it heavily
; paste selection in Darken-Only mode on Min
; paste selection in Lighten-Only mode on Max
; Compute (Base-Min)/(Max-Min)
; Grain-Extract Base from that result to get Grain Merge layer

(define (script-fu-max-loc-contrast theImage
theDrawable
Radius-pct
myThresh
feather-factor
keepMinMaxLayers
)
;Start an undo group so the process can be undone with one undo
(gimp-image-undo-group-start theImage)

; Copy the visible image to new layer and desaturate it
(let* (
(base-layer (car (gimp-layer-new-from-visible theImage theImage "Base")))
(base-copy ())
(width (car (gimp-drawable-width theDrawable)))
(height (car (gimp-drawable-height theDrawable)))
(scaledown-factor (+ 1 (round (/ (min width height) 300)) ))
(new-width (round (/ width scaledown-factor)))
(new-height (round (/ height scaledown-factor)))
)
(gimp-image-add-layer theImage base-layer -1)
(gimp-image-raise-layer-to-top theImage base-layer)

(if (< 0 (car (gimp-drawable-is-rgb base-layer)))
(gimp-desaturate-full base-layer DESATURATE-LUMINOSITY)
)
(set! base-copy (car (gimp-layer-copy base-layer FALSE)))
(if (> scaledown-factor 1)
(begin
(gimp-layer-scale base-layer new-width new-height FALSE)
(gimp-layer-resize base-layer new-width new-height 0 0)
)
)
(let (
(min-layer (car (gimp-layer-copy base-layer 1)))
(max-layer (car (gimp-layer-copy base-layer 1)))
(theRadius (/ (* Radius-pct (max width height)) (* scaledown-factor 100)))
)
(gimp-drawable-set-name min-layer "Min")
(gimp-image-add-layer theImage min-layer -1)
(gimp-drawable-set-name max-layer "Max")
(gimp-image-add-layer theImage max-layer -1)

;Loop through the colors, mapping local Max and Min values
(letrec ((loop (lambda (i max)
(let* (
;; Weird: feathering > theRadius mutes haloes.
(feather-pixels (* theRadius feather-factor))
(grayval (+ i myThresh))
(grayRGB (list grayval grayval grayval))
)
(gimp-selection-none theImage)
(gimp-by-color-select base-layer grayRGB myThresh CHANNEL-OP-REPLACE FALSE FALSE 0 FALSE)
(if (= TRUE (car (gimp-selection-bounds theImage)))
(begin
(gimp-selection-grow theImage theRadius)
(gimp-selection-feather theImage feather-pixels)
(gimp-context-set-foreground grayRGB)
(gimp-edit-bucket-fill max-layer FG-BUCKET-FILL LIGHTEN-ONLY-MODE 100 0 0 0 0)
(gimp-edit-bucket-fill min-layer FG-BUCKET-FILL DARKEN-ONLY-MODE 100 0 0 0 0)
)
)
(gimp-progress-update (/ i 260))
(if (< (+ i myThresh myThresh) max) (loop (+ i myThresh myThresh) max))
)
)
))
(loop 0 255)
)
(gimp-selection-none theImage)

; Now that we have Max and Min, scale them back up
(if (> scaledown-factor 1)
(begin
(gimp-layer-resize min-layer new-width new-height 0 0)
(gimp-layer-scale min-layer width height FALSE)
(gimp-layer-resize max-layer new-width new-height 0 0)
(gimp-layer-scale max-layer width height FALSE)
)
)

(gimp-image-raise-layer-to-top theImage min-layer)
(gimp-layer-set-mode min-layer SUBTRACT-MODE)
;; This is necessary for new-from-visible to work right
(gimp-edit-copy-visible theImage)
(let (
(max-min-layer (car (gimp-layer-new-from-visible theImage theImage "Max-Min")))
)
(gimp-image-add-layer theImage max-min-layer -1)

(gimp-drawable-set-visible max-min-layer FALSE)
(gimp-drawable-set-visible max-layer FALSE)
(gimp-layer-set-mode max-min-layer DIVIDE-MODE)
;; Put the base-copy (unscaled) on top of base-layer
(gimp-image-set-active-layer theImage base-layer)
(gimp-image-add-layer theImage base-copy -1)
(gimp-image-remove-layer theImage base-layer)
;; Again, for new-from-visible to work right
(gimp-edit-copy-visible theImage)
(let (
(base-min-layer (car (gimp-layer-new-from-visible theImage theImage "Base-Min")))
)
(gimp-displays-flush)
(gimp-image-add-layer theImage base-min-layer -1)
(gimp-image-raise-layer-to-top theImage base-min-layer)
)
(gimp-image-raise-layer-to-top theImage max-min-layer)
(gimp-drawable-set-visible max-min-layer TRUE)
(if (= TRUE keepMinMaxLayers)
;; just make them normal/invisible
(begin (gimp-layer-set-mode min-layer NORMAL-MODE)
(gimp-drawable-set-visible min-layer FALSE)
)
;; else delete Min and Max layers
(begin (gimp-image-remove-layer theImage min-layer)
(gimp-image-remove-layer theImage max-layer)
)
)
(let ((layer-mask (car (gimp-layer-create-mask base-copy WHITE-MASK))))
(gimp-edit-copy max-min-layer)
(gimp-drawable-set-name (car (gimp-image-merge-down theImage max-min-layer 2))
"Contrast Enhanced")
(gimp-image-raise-layer-to-top theImage base-copy)
(gimp-layer-set-mode base-copy GRAIN-EXTRACT-MODE)
(set! base-copy (car (gimp-image-merge-down theImage base-copy 2)))
(gimp-layer-set-mode base-copy GRAIN-MERGE-MODE)
(gimp-layer-add-mask base-copy layer-mask)
(gimp-floating-sel-anchor (car (gimp-edit-paste layer-mask 0)))
)
)
)
)
(gimp-displays-flush)

;End the undo group
(gimp-image-undo-group-end theImage)
)

(script-fu-register "script-fu-max-loc-contrast"
_"<Image>/Colors/Contrast/Maximize Local Contrast..."
"Stretch contrast based on local pixel maximum and minimum values"
"Roy Johnson"
"2009, Roy Johnson"
"June 2009"

"RGB* GREY"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Radius as % of image size" '(4 1 5 0.1 0.5 1 0)
SF-ADJUSTMENT _"Threshold" '(4 1 10 1 1 0 0)
SF-ADJUSTMENT _"Feather haloes" '(8 1 20 1 1 0 0)
SF-TOGGLE _"Keep Min and Max Layers" FALSE
)

Now look what big and in bold, that is clear as english may be, again this block on line is always close to the end of the script

(script-fu-register "script-fu-max-loc-contrast"
_"<Image>/Colors/Contrast/Maximize Local Contrast..."
"Stretch contrast based on local pixel maximum and minimum values"
"Roy Johnson"
"2009, Roy Johnson"
"June 2009"


What highlighted _"<Image>/Colors/Contrast/Maximize Local Contrast..." is where the plugin in the menu, here is image windows, COLORS menu, Contrast submenu

Note that now you may also change , as exmple if you prefer have it in the Filters menu
_"<Image>/Filters/Contrast/Maximize Local Contrast..."

or even create a new menu "MyScriptCollection"
_"<Image>/MyScriptCollection/Contrast/Maximize Local Contrast..."

anyway to know where to search the script in menu just look for that line,

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Tue Apr 12, 2011 2:56 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
Thank you Rod,

That worked for me, too.

Stay well.

:tyspin


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Tue Apr 12, 2011 5:35 am  (#13) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16270
josephbupe wrote:
Thank you Rod,

That worked for me, too.

Stay well.

:tyspin


You bet, glad to be able to help.

Stay well yourself. :)

_________________
Image


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Tue Apr 12, 2011 7:05 am  (#14) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
as for the "layer effect" script nobody may predict where will be installed because there are several variants of same script each use a different place (from new "Fx foundry " or "Script fu" menu, to the more probable Layer menu,or even in the Filters menu )

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Fri Apr 29, 2011 6:11 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
I downloaded the new released GIMP 2.7.3 by Partha, and everything worked fine with all scripts spearing like in Rod's screenshort.

Thanks to all.


Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Fri Apr 29, 2011 8:26 am  (#16) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16270
josephbupe wrote:
I downloaded the new released GIMP 2.7.3 by Partha, and everything worked fine with all scripts spearing like in Rod's screenshort.

Thanks to all.


If you are interested in having the script show in Layers here is the code.
Attached as a zip file.Just delete the original, and unzip to your script directory.

With this code all the scripts will be located in the Layer/Layer Effects sub menu.
Like this:
Image

You will also see the name of the layer script as installed (layerfx.scm), at the end of each description pop-up.
Very useful if you ever want to find the installed script. :)
Example:
Image


Attachments:
File comment: LayerFX.scm puts script under Layer menu.Adds script name to the description pop-up also.
LayerFX_SCM.zip [7.71 KiB]
Downloaded 104 times

_________________
Image
Top
 Post subject: Re: New scripts in GIMP 2.7.2
PostPosted: Fri Apr 29, 2011 8:28 am  (#17) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16270
By the way make sure to add a alpha channel to the layer so the script will work.
LayerFX.scm doesn't work without an alpha channel.

_________________
Image


Top
Post new topic Reply to topic  [ 17 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group