RSS/Atom feed Twitter
Site is read-only, email is disabled

Problem with plug-in-sample-colorize in batch mode

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Problem with plug-in-sample-colorize in batch mode Maarten De Munck 24 Jan 20:40
  Problem with plug-in-sample-colorize in batch mode saulgoode@flashingtwelve.brickfilms.com 25 Jan 15:49
  Problem with plug-in-sample-colorize in batch mode saulgoode@flashingtwelve.brickfilms.com 27 Jan 14:52
   Problem with plug-in-sample-colorize in batch mode Maarten De Munck 27 Jan 19:52
Maarten De Munck
2011-01-24 20:40:52 UTC (almost 14 years ago)

Problem with plug-in-sample-colorize in batch mode

I want to sample colorize a lot (a few hundred) of black-and-white images (scanned from negative and retouched and so on). I would like to avoid doing it manually, so I searched and I discovered the batch mode of the Gimp. I had a Scheme class about 15 years ago, and it looks like I still remembered something.

With some help of some examples found on the net and the Gimp help, I wrote the script:

(define (maarten-tiff-jpeg pattern                            samplefilename)   (let* ((filelist (cadr (file-glob pattern 1)))          (sampleimage (car (gimp-file-load RUN-NONINTERACTIVE samplefilename samplefilename)))
         (sampledrawable (car (gimp-image-get-active-layer sampleimage))))     (while (not (null? filelist))
           (let* ((filename (car filelist))                   (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
                  (drawable)
                  (fileparts)
                  (filenamejpeg))
             (set! drawable (car (gimp-image-get-active-layer image)))              (plug-in-sample-colorize RUN-NONINTERACTIVE image drawable sampledrawable TRUE TRUE FALSE TRUE 0 255 1.0 0 255)              (set! fileparts (strbreakup filename "."))              (set! fileparts (butlast fileparts))              (set! filenamejpeg (string-append (unbreakupstr fileparts ".") ".jpg"))
             (gimp-file-save RUN-NONINTERACTIVE image drawable filenamejpeg filenamejpeg)
             (gimp-image-delete image))            (set! filelist (cdr filelist)))     (gimp-image-delete sampleimage)))

And it seems to work fine, except for the plug-in-sample-colorize call. So it reads the tiff file and writes a jpeg file. I also tried to explicitly convert the grayscale image to rgb before the plug-in-sample-colorize call, but it doesn't really help (well, the resulting jpeg file is a black and white rgb image in that case, so the command is actually executed, but it is still not sample-colorized).

Anybody any idea what I'm doing wrong?

Maarten

Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
saulgoode@flashingtwelve.brickfilms.com
2011-01-25 15:49:31 UTC (almost 14 years ago)

Problem with plug-in-sample-colorize in batch mode

The problem seems to lie with Sample Colorize plug-in. From looking at the source code, it appears to not actually do anything if invoked noninteractively. I will investigate further and report back.

Quoting Maarten De Munck :

I want to sample colorize a lot (a few hundred) of black-and-white images (scanned from negative and retouched and so on). I would like to avoid doing it manually, so I searched and I discovered the batch mode of the Gimp. I had a Scheme class about 15 years ago, and it looks like I still remembered something.

With some help of some examples found on the net and the Gimp help, I wrote the script:

(define (maarten-tiff-jpeg pattern                            samplefilename)   (let* ((filelist (cadr (file-glob pattern 1)))          (sampleimage (car (gimp-file-load RUN-NONINTERACTIVE samplefilename samplefilename)))
         (sampledrawable (car (gimp-image-get-active-layer sampleimage))))     (while (not (null? filelist))
           (let* ((filename (car filelist))                   (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
                  (drawable)
                  (fileparts)
                  (filenamejpeg))
             (set! drawable (car (gimp-image-get-active-layer image)))              (plug-in-sample-colorize RUN-NONINTERACTIVE image drawable sampledrawable TRUE TRUE FALSE TRUE 0 255 1.0 0 255)              (set! fileparts (strbreakup filename "."))              (set! fileparts (butlast fileparts))              (set! filenamejpeg (string-append (unbreakupstr fileparts ".") ".jpg"))
             (gimp-file-save RUN-NONINTERACTIVE image drawable filenamejpeg filenamejpeg)
             (gimp-image-delete image))            (set! filelist (cdr filelist)))     (gimp-image-delete sampleimage)))

And it seems to work fine, except for the plug-in-sample-colorize call. So it reads the tiff file and writes a jpeg file. I also tried to explicitly convert the grayscale image to rgb before the plug-in-sample-colorize call, but it doesn't really help (well, the resulting jpeg file is a black and white rgb image in that case, so the command is actually executed, but it is still not sample-colorized).

Anybody any idea what I'm doing wrong?

Maarten _______________________________________________ Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
saulgoode@flashingtwelve.brickfilms.com
2011-01-27 14:52:56 UTC (almost 14 years ago)

Problem with plug-in-sample-colorize in batch mode

If you apply the patch attached to the following bug report and recompile the plug-in, your script should then work.

https://bugzilla.gnome.org/show_bug.cgi?id=640612

Maarten De Munck
2011-01-27 19:52:03 UTC (almost 14 years ago)

Problem with plug-in-sample-colorize in batch mode

It works perfectly! Thank you for your help!

Best regards,

Maarten

2011/1/27 :

If you apply the patch attached to the following bug report and recompile the plug-in, your script should then work.

https://bugzilla.gnome.org/show_bug.cgi?id=640612