Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script "slice using guides" and "png export"
#5
OK, thanks lot !
indeed, this script is almost perfect for me.
I added the "plug-in-guillotine", it works.
The "gimp-image-flatten" also works. But indeed it removes the alpha Confused .

So I'm trying to make the "gimp-layer-new-from-visible" work,
But it's more complex and I can't find how to call it effectively it seems that it needs to be combined with "gimp-image-insert-layer". 
But that's beyond my skills, does anyone have an example of a piece of code where "gimp-layer-new-from-visible" is functional ?

The code with "plug-in-guillotine" ;
Code:
; 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.


(define    (plug-in-guillotine RUN-NONINTERACTIVE
            image
            
    ))            

(define (script-fu-save-all-images inDir
          inSaveType
          inFileName
          inFileNumber)
 (let* (
         (i (car (gimp-image-list)))
         (ii (car (gimp-image-list)))
         (image)
         (newFileName "")
         (saveString "")
         (pathchar (if (equal? (substring gimp-dir 0 1) "/") "/" "\\"))
       )
   (set! saveString
     (cond
       (( equal? inSaveType 0 ) ".png" )
       (( equal? inSaveType 1 ) ".bmp" )
       (( equal? inSaveType 2 ) ".jpg" )
       (( equal? inSaveType 3 ) ".tif" )
     )
   )
   (while (> i 0)
     (set! image (vector-ref (cadr (gimp-image-list)) (- i 1)))
     (set! newFileName (string-append inDir
             pathchar inFileName
             (substring "00000" (string-length
             (number->string (+ inFileNumber i))))
             (number->string (+ inFileNumber i)) saveString))
    

    
            

     (gimp-file-save RUN-NONINTERACTIVE
                     image
                     (car (gimp-image-get-active-layer image))
                     newFileName
                     newFileName
     )
     (gimp-image-clean-all image)
     (set! i (- i 1))
   )
 )
)




(script-fu-register "script-fu-save-all-images"
"<Image>/Save ALL As"
"Save all opened images as ..."
"Lauchlin Wilkinson (& Saul Goode)"
"Lauchlin Wilkinson (& Saul Goode)"
"2014/04/21"
""
SF-DIRNAME    "Save Directory" ""
SF-OPTION     "Save File Type" (list "png" "bmp" "jpg" "tif")
SF-STRING     "Save File Base Name" "IMAGE"
SF-ADJUSTMENT "Save File Start Number" (list 0 0 9000 1 100 0 SF-SPINNER)
)
Reply


Messages In This Thread
RE: Script "slice using guides" and "png export" - by Lamidetlm - 10-25-2022, 04:56 PM

Forum Jump: