; dmmConvertPNGtoJPG.scm - GIMP Script-Fu to Convert PNG to JPG ; This Script-Fu must be put in The GIMP's script directory ; (e.g., $HOME/.gimp-1.2/scripts). ; For command-line invocation, use the shell script dmmConvertPNGtoJPG.sh ; For interactive invocation, run The GIMP and go to ; Xtns -> Script-Fu -> dmm ; (define (dmmConvertPNGtoJPG infile outfile) (let* ((image (car (file-png-load 1 infile infile))) (drawable (car (gimp-image-active-drawable image))) ) (file-jpeg-save 1 image drawable outfile outfile 0.75 0 1 1 "GIMP" 0 1 0 0 ) ; 0.75 quality (float 0 <= x <= 1) ; 0 smoothing factor (0 <= x <= 1) ; 1 optimization of entropy encoding parameter (0/1) ; 1 enable progressive jpeg image loading (0/1) ; "xxxx" image comment ; 0 subsampling option number ; 1 force creation of a baseline JPEG ; 0 frequency of restart markers ; in rows, 0 = no restart markers ; 0 DCT algoritm to use ) ) (script-fu-register ; I always forget these ... "dmmConvertPNGtoJPG" ; script name to register "/Xtns/Script-Fu/dmm/dmmConvertPNGtoJPG" ; where it goes "dmm Convert PNG to JPG" ; script description "David M. MacMillan" ; author "Copyright 2004 by David M. MacMillan; GNU GPL" ; copyright "2004-01-27" ; date "" ; type of image SF-FILENAME "Infile" "infile.png" ; default parameters SF-FILENAME "Outfile" "outfile.png" ) ; Copyright 2004 by David M. MacMillan ; This work 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. ; NOTICE OF DISCLAIMER OF WARRANTY AND LIABILITY: ; This work is distributed 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. ; In no event will the author(s), editor(s), or publisher(s) of this work ; be liable to you or to any other party for damages, ; including but not limited to any general, special, incidental ; or consequential damages arising out of your use of or inability to use this ; work or the information contained in it, even if you have been advised ; of the possibility of such damages. ; In no event will the author(s), editor(s), or publisher(s) of this work ; be liable to you or to any other party for any injury, death, ; disfigurement, or other personal damage arising out of your use of ; or inability to use this work or the information ; contained in it, even if you have been advised of the ; possibility of such injury, death, disfigurement, or other ; personal damage. ; You should have received a copy of the GNU General Public License ; along with this work; if not, write to the ; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ; Boston, MA 02111-1307, USA.