Post Reply 

Anaglyph Batch Processing

Jun 27, 2012, 06:12
Post: #1
Anaglyph Batch Processing
I bought a 3D camera, and it takes video which is awesome. I don't have a 3D tv, but I do have some red-cyan glasses, and after much learning I wrote a script to convert the horizontally split images into the 2-color anaglyphs.

I want to be able to batch the process so that I can chop, process, and stitch video files that my camera gives me.

After a lot of searching, I wrote a batch file, wrote a batch script, and now all I get are execution errors. I have pinned down that the error times at about the place where the batch script is saving the new file. I decided to run the command prompt as an admin, and it says that the script ran successfully, but nothing happens to my image files. I have tried about all that I can think of, and would like some help with it. I attached my anaglyph script and pasted my batch below. Thanks in advance!

My batch command placed in my image folder:
"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" -i -b "(batch-cr-anaglyph \"*.jpg\")" -b "(gimp-quit 0)"

My batch script in a registered directory:

(define (batch-cr-anaglyph pattern)
;Get File List from Glob String
(filelist (cadr (file-glob pattern 1)))
(while (not (null? filelist))
(let* (
(filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(script-fu-cr-anaglyph-batch image)
(set! drawable (car (gimp-image-get-active-layer image)))
;Save File
(file-jpeg-save 1 image drawable filename filename 0.95 0 0 "" 2 0 0 1)
(gimp-image-delete image)
(set! filelist (cdr filelist))
);end let
);end while
);end let
);end define

Attached File(s)
.scm  script-fu-cr-anaglyph-batch.scm (Size: 2.86 KB / Downloads: 70)
Find all posts by this user
Quote this message in a reply
Jun 27, 2012, 17:31
Post: #2
RE: Anaglyph Batch Processing
I added in the lost parameter before the comment string argument. I still get the same result. Running as admin says success when it doesn't take nearly long enough, and regular execution takes the right amount of time, but comes up with an execution error. Thanks for the save parameter catch though. That probably would have caused issues.

Should I need to run these things as an admin at all?
Find all posts by this user
Quote this message in a reply
Jun 27, 2012, 23:19
Post: #3
RE: Anaglyph Batch Processing
All right, so I used the --verbose to see what was going on, and it experiences death after

No batch interpreter specified, using the default 'plug-in-script-fu-eval'.

With admin privileges, the console reports batch success, but does not take enough time (the code takes about 20 seconds to run on my photos) before it reports success.

I tried running it interactively, and without admin, the gui loads, the file gets read-in, but the image does not turn up in the gui. I haven't run other scripts through the console, so I wouldn't know if this is right. The progress bar runs for both resizing steps in my script, and then afterword, fails. My guess at the save point.

When running interactively with admin access, the file does not even get read-in and reports success?

I realize that admin access is probably not the issue, but I figured I would try anyway just in case.

I am guessing that I need to specify a working batch interpreter since gimp isn't even getting to the batch script? What is a stable batch interpreter I can use, and how do I specify it?
Find all posts by this user
Quote this message in a reply
Jun 27, 2012, 23:25
Post: #4
RE: Anaglyph Batch Processing
After taking a quick look, I see that the script-fu batch interpreter default is the interpreter I should use. Now I am lost as to what is going on.
Find all posts by this user
Quote this message in a reply
Jun 28, 2012, 14:34
Post: #5
RE: Anaglyph Batch Processing
That happens to be the most amazing thing since sliced bread!

Thank you all for all of your help with this. If you guys weren't here, I would have considered it a dead-end and tried to learn CUDA c or something crazy like that. (i might anyways, but at least I don't need to now)
Find all posts by this user
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Batch create images from array edmilner 1 632 Jul 17, 2017 16:41
Last Post: ythgilb
  How to close gimp with batch command? flixe 1 650 Jun 19, 2017 12:29
Last Post: ythgilb
  Bashing my head - Batch Python Script nmiltner 1 755 Sep 5, 2014 00:58
Last Post: nmiltner
  processing tile by tile janny 3 510 Jul 21, 2014 15:50
Last Post: janny
  Batch processing script Help jarboe3142 1 661 Jun 1, 2014 18:45
Last Post: rich2005

Forum Jump:

GIMP ForumPortalArchiveContactTermsRSS