Post Reply 

batch colorize script.

May 11, 2012, 10:05
Post: #1
batch colorize script.
hey folks-
i am starting a decal business and i have jpg's of all the decal designs in black on a white background.
i need to batch colorize a bunch of images, i figured out how to do it individually and save but i need to colorize all the images in a folder and save with a different name.
i found a great script to batch convert jpgs to pngs, and am trying to edit it to work.

i think just the line in red needs to be written correctly. any help would be appreciated.

(define (colorize it DirectoryName)
(let*
(
(fileExtension ".jpg") ; we are looking for .jpg files
(varFileList (cadr (file-glob (string-append DirectoryName DIR-SEPARATOR "*" fileExtension) 1) ) ) ; find them all
)
(while (not (null? varFileList)) ; scan through the list of files
(let* ((filename (car varFileList))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) ; open the file
(drawable (car (gimp-image-flatten image)))

; filename with a .png extension
(png_filename (string-append (substring filename 0 (- (string-length filename) (string-length fileExtension))) ".png"))
)
; (gimp-message (string-append "processing-" filename))


; THIS IS WHERE TO PUT THE IMAGE PROCESSING
'(colorize "*.png" 244 48 18)' '(gimp-quit 0)' ; convert black to blue maybe
(file-png-save RUN-NONINTERACTIVE image drawable png_filename png_filename FALSE 9 FALSE FALSE FALSE FALSE FALSE) ; save as a png
(gimp-image-delete image) ; tidy up
)
(set! varFileList (cdr varFileList)) ; remove the processed file from the list
)
)
)

(define (colorize_it DirectoryName)
(let* (
)
(colorize it DirectoryName)
)

)

(script-fu-register "colorize_it"
_"Colorize images..."
"Interactive front end to colorize batch job"
"I did this"
"GPL License"
"19/11/2010"
""
SF-DIRNAME _"Source Directory" ""
)

(script-fu-menu-register "colorize_it"
"<Image>/colorrrr")
Find all posts by this user
Quote this message in a reply
May 11, 2012, 12:09 (This post was last modified: May 11, 2012 12:14 by rich2005.)
Post: #2
RE: batch colorize script.
There is a very new gimp plugin that does what you want (I think)
BIMP - batch image manipulation plugin
http://registry.gimp.org/node/26259

It has the ability to use gimp procedures, colorize is one that works

Example on a single file but works on many

http://i.imgur.com/xeQHg.jpg

edit: it renames as well.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
May 11, 2012, 16:44
Post: #3
RE: batch colorize script.
i have tried that a little, there is no built in colorize, but it can run other scripts.
not sure what i need to do.
i could probably figure it out if i knew how to code the one line in the above script.

i need to colorize single images into many different colors and save the files with a different name.
Find all posts by this user
Quote this message in a reply
May 11, 2012, 17:55
Post: #4
RE: batch colorize script.
Well, it is not rocket science.

I am sure someone will be along to help you with your script.

For those who might be interested in BIMP, how to apply colorize, change the output format and rename.

http://youtu.be/ghYXSFKP7_8 (3 mins)

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
May 11, 2012, 18:31 (This post was last modified: May 11, 2012 18:32 by tecvoid.)
Post: #5
RE: batch colorize script.
thanks rich!
i thought i tried what you did, but i must not have chosen the right colorize script.

with your method i think ill be able to do all the colors i need in one batch process.
will let you know the results.
+rep!!!!!!!!!!!!!!!!!1
Tec
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Batch adding logo to lots of pictures kenny1999 2 262 Sep 27, 2014 08:02
Last Post: rich2005
  batch processing to obtain several different versions of a picture esteban 3 243 Sep 23, 2014 14:44
Last Post: esteban
  batch processing (OSX) pace514 3 305 Sep 21, 2014 08:03
Last Post: rich2005
  Create new images button & Save as override from Script-fu beniman 12 482 Sep 10, 2014 10:57
Last Post: paynekj
  Batch conversion of images qazmlpok 7 3,068 Feb 18, 2014 19:35
Last Post: MBG

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS