Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script "slice using guides" and "png export"
#1
Python 
Hello everyone, first sorry if my English is average (I'm a stupid French).
As part of a 3d project, I need to develop a small script for gimp. I hope I'm in the right place Smile



I would need a script that follows these steps;
- save the file
- merge all layers
- slice using guides
-export the different images created in .png.as it is all I can do is put the layers together and save each image in Gimp format.

I've scoured the web and tried to combine the scripts found:


Code:
(define (script-fu-save-png Image layer)
  (let* ((i (car (gimp-image-list))) 
         (image))
    (while (> i 0) 
      (set! image (vector-ref (cadr (gimp-image-list)) (- i 1)))
      (gimp-file-save RUN-NONINTERACTIVE 
                      image 
                      (car (gimp-image-merge-visible-layers image 0))                      
                      (car (gimp-image-get-filename image)) 
                      (car (gimp-image-get-filename image))) 
      (gimp-image-clean-all image) 
      (set! i (- i 1))))) 



(script-fu-register
   "script-fu-save-png"
   "<Image>/File/Save PNG & Exit"
   "Save PNG file and exit GIMP."
   "kes"
   "kes"
   "October 2017"
   "RGB*, GRAY*, INDEXED*"
   SF-IMAGE         "Image" 0
   SF-DRAWABLE   "Layer" 0
)

As it is all I can do is put the layers together and save each image in Gimp format.

In the state I do the "slice using guides" me myself. 
Then the script gathers the layers and saves each image in Gimp format.

I can't find the command to do the "slice using guides" nor the modification to switch to png.

Any ideas ?

Thank you for reading me Smile
Reply


Messages In This Thread
Script "slice using guides" and "png export" - by Lamidetlm - 10-24-2022, 01:26 PM

Forum Jump: