08-11-2021, 06:09 PM
(This post was last modified: 08-11-2021, 07:55 PM by BubbleFritten.)
Hello,
i want to convert some jpeg's to monochrome pcx. To solve the problems step by step my first try is to convert to monochrome jpg, but this didn't work.
The saved picture is still colorized. Even if i try the greyscale command it's colorized.
What's wrong with the script?
EDIT
for testing purposes i have made the following version, it didn't work.
The result is not grayscaled.
i want to convert some jpeg's to monochrome pcx. To solve the problems step by step my first try is to convert to monochrome jpg, but this didn't work.
The saved picture is still colorized. Even if i try the greyscale command it's colorized.
What's wrong with the script?
Code:
(define (convert-mono pattern )
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(gimp-image-convert-indexed image CONVERT-DITHER-NONE CONVERT-PALETTE-MONO 0 0 1 "" )
(drawable (car (gimp-image-get-active-layer image))))
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
for testing purposes i have made the following version, it didn't work.
The result is not grayscaled.
Code:
(define (convert-mono pattern )
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* (
(filename (car filelist))
(destination_file "")
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-flatten image)))
(gimp-image-convert-grayscale image)
)
(set! destination_file (string-append "out-" filename))
(gimp-file-save RUN-NONINTERACTIVE image drawable destination_file destination_file)
(gimp-image-delete image)
)
(set! filelist (cdr filelist)))
)
)