/usr/share/gimp/2.0/scripts/egger-iso-noise-reduction.scm is in gimp-plugin-registry 5.20120621.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | ;
; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; Sensor Noise Reduction script for GIMP 2.4
; Original author: Martin Egger (martin.egger@gmx.net)
; (C) 2005, Bern, Switzerland
;
; Tags: photo, noise
;
; Author statement:
;
; You can find more about ISO Noise Reduction at
; http://www.gimpguru.org/Tutorials/ReducingCCDNoise/
; but this script uses a different method (masking the edges and then
; blurring the individual color channels or the lumimance channel only).
;
;
; --------------------------------------------------------------------
; Distributed by Gimp FX Foundry project
; --------------------------------------------------------------------
; - Changelog -
; 02.11.2007 - fixed for gimp 2.4 by Alexia Death. Lab
; layer order for recompose has inversed between versions
; This script WILL NOT work right for 2.2
; --------------------------------------------------------------------
;
; 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.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Define the function
;
(define (script-fu-Eg-ISONoiseReduction InImage InLayer InType InOpacity InRadius InFlatten)
;
; Save history
;
(gimp-image-undo-group-start InImage)
(if (= (car (gimp-drawable-is-rgb InLayer)) FALSE ) (gimp-image-convert-rgb InImage))
;
(let* (
(NoiseLayer (car (gimp-layer-copy InLayer TRUE)))
(TempLayer (car (gimp-layer-copy InLayer TRUE)))
(InDelta (* InRadius 7 ))
(RadiusRB (* InRadius 1.5))
(DeltaRB (* InDelta 2))
)
;
(gimp-image-add-layer InImage NoiseLayer -1)
(gimp-image-add-layer InImage TempLayer -1)
;
; Find edges, Radius = 10, Warpmode = Smear (1), Edgemode = Laplace (5)
;
(plug-in-edge TRUE InImage TempLayer 10 1 5)
(gimp-desaturate TempLayer)
(gimp-invert TempLayer)
(plug-in-gauss TRUE InImage TempLayer 10.0 10.0 TRUE)
(gimp-selection-all InImage)
(gimp-edit-copy TempLayer)
(gimp-image-remove-layer InImage TempLayer)
;
(let* (
(NoiseLayerMask (car (gimp-layer-create-mask NoiseLayer ADD-SELECTION-MASK)))
)
(gimp-layer-add-mask NoiseLayer NoiseLayerMask)
(gimp-floating-sel-anchor (car (gimp-edit-paste NoiseLayerMask FALSE)))
(gimp-selection-none InImage)
;
; Select method
;
(cond
;
; Blur seperate RGB channels, use different radius/delta for Red/Blue and Green
;
((= InType 0)
(begin
(gimp-image-set-component-active InImage RED-CHANNEL TRUE)
(gimp-image-set-component-active InImage GREEN-CHANNEL FALSE)
(gimp-image-set-component-active InImage BLUE-CHANNEL FALSE)
(plug-in-sel-gauss TRUE InImage NoiseLayer RadiusRB DeltaRB)
;
(gimp-image-set-component-active InImage RED-CHANNEL FALSE)
(gimp-image-set-component-active InImage GREEN-CHANNEL TRUE)
(plug-in-sel-gauss TRUE InImage NoiseLayer InRadius InDelta)
;
(gimp-image-set-component-active InImage GREEN-CHANNEL FALSE)
(gimp-image-set-component-active InImage BLUE-CHANNEL TRUE)
(plug-in-sel-gauss TRUE InImage NoiseLayer RadiusRB DeltaRB)
;
(gimp-image-set-component-active InImage RED-CHANNEL TRUE)
(gimp-image-set-component-active InImage GREEN-CHANNEL TRUE)
)
)
;
; Blur luminance channel
;
((= InType 1)
(begin
(let* (
(OrigLayer (cadr (gimp-image-get-layers InImage)))
(LABImage (car (plug-in-decompose TRUE InImage InLayer "LAB" TRUE)))
(LABLayer (cadr (gimp-image-get-layers LABImage)))
(LLayer (car (gimp-layer-copy InLayer TRUE)))
)
;
(gimp-image-add-layer InImage LLayer -1)
(gimp-selection-all LABImage)
(gimp-edit-copy (aref LABLayer 0))
(gimp-floating-sel-anchor (car (gimp-edit-paste LLayer FALSE)))
(plug-in-sel-gauss TRUE InImage LLayer RadiusRB DeltaRB)
(gimp-selection-all InImage)
(gimp-edit-copy LLayer)
(gimp-image-remove-layer InImage LLayer)
(gimp-floating-sel-anchor (car (gimp-edit-paste (aref LABLayer 0) FALSE)))
(let* (
(CompImage (car (plug-in-drawable-compose TRUE LABImage (aref LABLayer 0) (aref LABLayer 1) (aref LABLayer 2) 0 "LAB")))
(CompLayer (cadr (gimp-image-get-layers CompImage)))
)
(gimp-selection-all CompImage)
(gimp-edit-copy (aref CompLayer 0))
(gimp-floating-sel-anchor (car (gimp-edit-paste NoiseLayer FALSE)))
(gimp-image-delete CompImage)
)
(gimp-image-delete LABImage)
)
)
)
;
; GMIP despeckle plugin
;
((= InType 2) (plug-in-despeckle TRUE InImage NoiseLayer InRadius 1 7 248))
)
(gimp-layer-set-edit-mask NoiseLayer FALSE)
(gimp-layer-set-opacity NoiseLayer InOpacity)
)
;
; Flatten the image, if we need to
;
(cond
((= InFlatten TRUE) (gimp-image-merge-down InImage NoiseLayer CLIP-TO-IMAGE))
((= InFlatten FALSE)
(begin
(gimp-drawable-set-name NoiseLayer _"Noisefree")
(gimp-image-set-active-layer InImage InLayer)
)
)
)
)
;
; Finish work
;
(gimp-image-undo-group-end InImage)
(gimp-displays-flush)
;
)
;
(script-fu-register
"script-fu-Eg-ISONoiseReduction"
_"ISO _Noise Reduction"
_"Reduce sensor noise at high ISO values"
"Martin Egger (martin.egger@gmx.net)"
"Martin Egger, Bern, Switzerland"
"07.10.2007"
"RGB* GRAY*"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-OPTION _"Noise Reduction Method"
'(
_"RGB channel blurring (faster)"
_"Luminance channel blurring (slower)"
_"GMIP Despeckle plugin"
)
SF-ADJUSTMENT _"Layer Opacity" '(70.0 1.0 100.0 1.0 0 2 0)
SF-ADJUSTMENT _"Radius of Blurring" '(5 1.0 10.0 0.5 0 2 0)
SF-TOGGLE _"Flatten Image" FALSE
)
;
(script-fu-menu-register "script-fu-Eg-ISONoiseReduction"
"<Image>/Filters/Eg")
;
|