Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Batch convert Jpeg into monochrome pcx
#1
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?


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)))))
EDIT
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)))
)
)
Reply
#2
I can not give you an answer, not a coding person, so I will bump this up and hope one of the clever guys sees it.
Reply


Forum Jump: