Hi i need help with part of code of script fu.
I have mixed up images in indexed and RGB mode. I want to open image, change to RGB if image is in indexed mode, change hue, save file.
Now everything works beside this missed part:
- if image is indexed convert to RGB, if image is actually in RGB then change hue (finish the script).
This is my script:
(define (change-hue filesNames)
(let* ((filelist (cadr (file-glob filesNames 1))))
(while (not (null? filelist))
(let* (
; Pobranie nazwy pliku
(fileName (car filelist))
; Otwarcie pliku:
(image (car (file-png-load 1 fileName fileName)))
; Pobranie warstwy
(darwable (car (gimp-image-get-active-layer image)))
)
; Zmiana na RGB
(gimp-image-convert-rgb image)
; Barwienie
(gimp-hue-saturation darwable 0 -145 0 0)
; Zapis do pliku
(file-png-save 1 image darwable fileName fileName 1 0 0 0 0 0 0)
)
; Zmiejszenie listy plików o jeden.
(set! filelist (cdr filelist))
)
)
)
(script-fu-register "change-hue"
"<Image>/Script-Fu/Zmiana odcienia"
"Otwiera, zmienia odcień i zapisuje plik png."
"jackq"
"jackq"
"Luty 2013"
""
SF-STRING "Pliki:" "E:\\1\\*.png"
)
Can anyone help me with this missed part of code?
Cheers.