; The GIMP -- an image manipulation program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; ; Copyright (C) 2010 Kevin Payne paynekj@hotmail.com ; ; Version 1.0 19.10.2010 Made this for siwilks200 on GimpChat ; see http://gimpchat.com/viewtopic.php?f=8&t=733&p=7577 (define (eps_to_png_batch_job DirectoryName) (let* ( (fileExtension ".eps") ; we are looking for .eps 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 (plug-in-colortoalpha RUN-NONINTERACTIVE image drawable '(255 255 255)) ; convert white to alpha (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 (interactive_eps_to_png_batch_job DirectoryName) (let* ( ) (eps_to_png_batch_job DirectoryName) ) ) (script-fu-register "interactive_eps_to_png_batch_job" _"Interactive EPS to PNG..." "Interactive front end to EPS to PNG batch job" "I did this" "GPL License" "19/11/2010" "" SF-DIRNAME _"Source Directory" "" ) (script-fu-menu-register "interactive_eps_to_png_batch_job" "/contributed")