09-08-2018, 06:19 PM
I was trying to use this plugin from external command line but could not figure it out.
Luckily I found http://beefchunk.com/documentation/lang/...-script-fu
With this finally I understood how to call this plugin, this is, not directly but via another script. For me it worked creating and registering my own script that used file-heif-save, after that it was just a matter of executing from bash, as shown in the link.
Using the great scripts developed by David M. MacMillan (thanks for sharing under GNU GPL), like dmmConvertPNGtoJPG, I changed bits and pieces so that script used file-heif-save instead of file-jpeg-save. Later it was a matter of placing it in GIMP scripts folder, refreshing GIMP's script-fu scripts, and calling the registered script from bash shell.
convertJPGtoHEIF.scm:
Register in GIMP and then execute from bash:
Hope it helps .
Luckily I found http://beefchunk.com/documentation/lang/...-script-fu
With this finally I understood how to call this plugin, this is, not directly but via another script. For me it worked creating and registering my own script that used file-heif-save, after that it was just a matter of executing from bash, as shown in the link.
Using the great scripts developed by David M. MacMillan (thanks for sharing under GNU GPL), like dmmConvertPNGtoJPG, I changed bits and pieces so that script used file-heif-save instead of file-jpeg-save. Later it was a matter of placing it in GIMP scripts folder, refreshing GIMP's script-fu scripts, and calling the registered script from bash shell.
convertJPGtoHEIF.scm:
Code:
(define (convertJPGtoHEIF infile outfile)
(let* ((image (car (file-jpeg-load 1 infile infile)))
(drawable (car (gimp-image-active-drawable image)))
)
(file-heif-save 1 image drawable outfile outfile
50 0 )
; 50 quality (int32 0 <= x <= 100)
; 0 use lossless compression (0 = lossy, 1 = lossless)
)
)
(script-fu-register
"convertJPGtoHEIF" ; script name to register
"<Toolbox>/Xtns/Script-Fu/conv/convertJPGtoHEIF" ; where it goes
"Convert JPG to HEIF" ; script description
"David M. MacMillan, modded by jmarcorb" ; author
"Copyright 2004 by David M. MacMillan; GNU GPL" ; copyright
"2018-09-08" ; date
"" ; type of image
SF-FILENAME "Infile" "infile.png" ; default parameters
SF-FILENAME "Outfile" "outfile.png"
)
Code:
gimp -c -i -d -b "(convertJPGtoHEIF \"image2.jpg\" \"image2.heif\")" "(gimp-quit 0)"
Hope it helps .