Btw, it would be very interesting to have a plug-in that outputs a
quality similar to NeatImage (not only for JPEG artifacts, but for
image enhancement in general)... do you know of something similar for
the Gimp?
I use <Image>/Filters/Blur/Selective Gaussian Blur. This filter will
already blurred parts, but will leave sharp details alone. I usually
use a threshold of about 15, which seems enough to remove the
artifacts without touching the rest of the image too much.
--
Deze geheele aarde door ijzeren banden omspannen, met de
stoomvaartlijnen die als draden over de zeeėn zijn getrokken,
Dezen wereldkloot in zijn tuimeling door het heelal breng ik U.
"Grashalmen", Walt Whitman, binnenkort op www.gutenberg.net
You can try this script ... not quite the final quality of NeatImage,
but better than nothing. BTW: this script uses the new GIMP 2.2
interface to 'Gaussian Blur' plugin - it will *not* run with 2.0 or below.
Martin
---
;
; ISO Noise Reduction, V1.1
;
; Martin Egger (martin...@gmx.net)
; (C) 2004, Bern, Switzerland
;
; 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).
;
; This plugin was tested with Gimp 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 spline values for curves
;
(define (set-pt a index x y)
(prog1
(aset a (* index 2) x)
(aset a (+ (* index 2) 1) y)
)
)
;
; Special curve for layer mask
;
(define (EdgeSpline)
(let* (
(a (cons-array 4 'byte))
)
(set-pt a 0 100 0)
(set-pt a 1 190 255)
a
)
)
;
; Define the function
;
(define (script-fu-Eg-ISONoiseReduction InImage InLayer InEdge InType
InRadius InDelta)
;
(let* (
(TempLayer (car (gimp-layer-copy InLayer TRUE)))
(RadiusRB (* InRadius 1.5))
(DeltaRB (* InDelta 2))
)
;
; Save history
;
(gimp-image-undo-group-start InImage)
;
(gimp-image-add-layer InImage TempLayer -1)
;
; Find edges, Radius = 2, Warpmode = Smear (1), Edgemode = Sobel (0)
;
(plug-in-edge TRUE InImage TempLayer InEdge 1 0)
(plug-in-gauss TRUE InImage TempLayer 4 4 0)
(gimp-curves-spline TempLayer HISTOGRAM-VALUE 4 (EdgeSpline))
(gimp-by-color-select TempLayer '(0 0 0) 80 CHANNEL-OP-ADD FALSE FALSE
0 FALSE)
(let* (
(MaskChannel (car (gimp-selection-save InImage)))
)
(gimp-image-remove-layer InImage TempLayer)
;
; Blur seperate RGB channels, use different radius/delta for Red/Blue
and Green
;
(if (= 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 InLayer 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 InLayer 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 InLayer RadiusRB DeltaRB)
;
(gimp-image-set-component-active InImage RED-CHANNEL TRUE)
(gimp-image-set-component-active InImage GREEN-CHANNEL TRUE)
(gimp-selection-none InImage)
)
)
;
; Blur luminance channel
;
(if (= 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 2))
(gimp-floating-sel-anchor (car (gimp-edit-paste LLayer FALSE)))
(gimp-selection-load MaskChannel)
(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
2) FALSE)))
(let* (
(CompImage (car (plug-in-drawable-compose TRUE LABImage (aref
LABLayer 2) (aref LABLayer 1) (aref LABLayer 0) 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 InLayer FALSE)))
(gimp-image-delete CompImage)
)
(gimp-image-delete LABImage)
)
)
)
(gimp-image-remove-channel InImage MaskChannel)
)
;
; Finish work
;
(gimp-image-undo-group-end InImage)
(gimp-displays-flush)
;
)
)
;
(script-fu-register
"script-fu-Eg-ISONoiseReduction"
"<Image>/Script-Fu/Eg/ISO Noise Reduction"
"Reduce sensor noise at high ISO values"
"Martin Egger (martin...@gmx.net)"
"2004, Martin Egger, Bern, Switzerland"
"8.10.2004"
"RGB* GRAY*"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-ADJUSTMENT "Edge search: Radius" '(2.5 1.0 10.0 0.5 0 2 0)
SF-OPTION "Noise Reduction Method"
'(
"RBG channel blurring (faster)"
"Luminance channel blurring (better)"
)
SF-ADJUSTMENT "Channel Blur: Radius" '(2.0 1.0 10.0 1.0 0 2 0)
SF-ADJUSTMENT "Channel Blur: Delta" '(15.0 1.0 50.0 1.0 0 2 0)
)
;