• Neuer Gutscheincode unseres Partners Schutzfolien24:
    DSLR-Forum2025
    Dauerhaft 10% Rabatt auf alle Displayschutzfolien und Schutzgläser der Eigenmarken
    "Upscreen", "Screenleaf", BROTECT" und "Savvies".
    Der Code ist für alle Geräteklassen gültig.
  • Mitmachen beim DSLR-Forum Fotowettbewerb Juli 2025.
    Thema: "Unscharf"

    Jeden Monat attraktive Gewinnprämien, gesponsert von unserem Partner PixelfotoExpress.
    Alle Infos zum Juli-Wettbewerb hier!
  • In eigener Sache!

    Liebe Mitglieder, liebe Besucher und Gäste
    ich weiß, es ist ein leidiges Thema, aber ich muss es ansprechen: Werbung, Werbeblocker und Finanzierung des Forums.
    Bitte hier weiterlesen ...

  • Nicht erreichbare Adressen im Benutzerkonto
    Wir bekommen zurzeit eine große Anzahl an E-Mails, die das System zum Beispiel als Benachrichtigungen an Nutzer verschickt,
    als unzustellbar zurück, weil z.B. die Adressen nicht erreichbar sind oder das Postfach gar nicht existiert.
    Stellt doch bitte sicher, dass die Benachrichtigungen, die ihr vom System erwartet, auch zugestellt werden können.
    Nicht erreichbare E-Mail-Adressen sind dazu wenig hilfreich.
    Danke!
WERBUNG

GIMP: Layer in Datei speichern?

helge.kippenberg

Themenersteller
Hallo,

ich habe eine Multilayer-Bild mit rd. 10 Ebenen.
Ich will jede Ebene in eine eigene Datei speichern. Eine Funktion dafür habe ich nicht gefunden, weilich a) blind bin oder b) nicht exitiert.

Ich lösche jetzt alle ausser ersten Ebene speicher dies als KOpie ab und stelle das Original mit den 10 Ebenen wieder her. Das ist ziemlich doof und dauert lange.
Hat jemand eine bessere Idee?

rgds,
Helge
 
Ich nutze Gimp häufig so eine Funktion ist mir auch noch nicht untergekommen.

Anderer Weg:

1. Gewünschte Ebene anwählen.
2. Alles Markieren + Kopieren (STRG-A / STRG-C)
3. Als neues Bild einfügen.
4. Abspeichern


Gruß Martin
 
KrasserMann schrieb:
1. Gewünschte Ebene anwählen.
2. Alles Markieren + Kopieren (STRG-A / STRG-C)
3. Als neues Bild einfügen.
4. Abspeichern

Oh Mann, bin ich doof. Das ist doch schon mal viel einfacher. Ich sollte jetzt hier mal ganz viele Bäume hinmalen:-)

rgds,
Helge
 
Kommt ja auch auf das Format an, das man speichern will. Sofern dies ein Format ohne Ebenen ist (also nicht .xcf, sondern eher .jpg oder ähnliches), kann man auch einfach die jeweils gewünschte Ebene sichtbar machen und mittels "Speichern unter" (Strg-Shift-s) speichern. Man wird dann gefragt, ob man zum Speichern exportieren möchte, was man natürlich bestätigt, und dann kann man mit der nächsten Ebene genauso weitermachen.

Das finde ich persönlich etwas einfacher, weil ich nicht dauernd das Bildfenster wechseln muss.
 
AW: GIMP: Layer in Datei speichern? ScriptFu added

Obiges Problem ist gelöst. Google sei Dank!

Habe ein Script gefunden, welches ich minimal anpassen musste, damit auch die TIFF-Ausgabe dabei ist.... das ist Programmierung die ich liebe: drei Zeilen hinzu, fertig ist der Schuh:-)

Nachfolgenden code speichern in continous_save.scm (oder was auch immer) und los gehts. Die Funktion ist dann unter "/Script-Fu/Utils/Continuous Save..." zu finden.

rgds,
Helge

Code:
; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; Continuous Save --- save the file which named "base-name_(number).(type)"
; Copyright (C) 2001 Iccii <iccii@hotmail.com>
;
; Modified by Tamubun <http://bunysmc.exblog.jp/>
;
; This script was born of miyoken's idea.
;
; Modified by helge kippenberg
;
; --------------------------------------------------------------------
;   - Changelog -
; version 0.1  2001/05/20 iccii <iccii@hotmail.com>
;     - Initial relase
; version 0.2  2001/05/24 iccii <iccii@hotmail.com>
;     - Make better
; version 0.3  2001/05/24 iccii <iccii@hotmail.com>
;     - Chose the filename with directory
;     - Saved image type equal to original image type
; version 0.3a 2001/09/26 iccii <iccii@hotmail.com>
;     - Bug fixed in checking the file type
;
; ====
;
; version 0.4-tamubun
;              2005/03/11 tamubun <http://bunysmc.exblog.jp/>
;     - Added "Digits" option, and changed the file names for each layer.
;     - Added "Reverse Order" option, to control output ordering.
;         (To use the original ordering, i.e. from top layer to bottom
;          layer, "Reverse Ordering" must be checked.)
;     - Unified "JPEG Compression" option and "PNG Compression" option
;         to single "Quality" option.
;     - Deleted "Interactive" option.
; version 0.5-tamubun
;              2005/03/29 tamubun <http://bunysmc.exblog.jp/>
;     - Added "Start Number" option.
; version 0.6-tamubun
;              2005/04/06 tamubun <http://bunysmc.exblog.jp/>
;     - Added "#" convention.
; version 0.6.1-kippenberg
;              2005/05/03
;     - Added tif output
;
; --------------------------------------------------------------------
;
; 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.
;


(define (script-fu-continuous-save
      img         ; IMAGE
      drawable      ; DRAWABLE (no need)
      save-type      ; saving image type
      file-name      ; base file name with directory
      digits         ; trailing 0's
      start                   ; start number
      reverse         ; If true, order from top to bottom
      quality         ; compression quality for JPG, PNG
      )

  (define (floor x) (- x (fmod x 1)))

  (define (div x y) (floor (/ x y)))

  (define (to-save-bmp img layer file-name)
     (file-bmp-save 1 img (car (gimp-image-flatten img)) file-name ""))

  (define (to-save-jpg img layer file-name jpg-comp)
     (file-jpeg-save 1 img (car (gimp-image-flatten img)) file-name ""
           (/ jpg-comp 100) 0.0 1 0 "" 0 0 0 1))

  (define (to-save-png img layer file-name png-comp)
     (file-png-save 1 img layer file-name "" 0 png-comp 1 1 1 1 1))

  (define (to-save-tif img layer file-name )
     (file-tiff-save 1 img layer file-name "" 0 0))


  (define (gen-name count ext)
     (let* ((zeros "0000000000")
       (str (number->string (+ start count)))
       (num (string-append zeros str))
       (pos (- (string-length num) (max digits (string-length str)))))
       (string-append file-name (substring num pos) ext)))

  (let* (
    (layers (gimp-image-get-layers img))
    (count 0)
    (number (car layers))
    (image-type (car (gimp-image-base-type img)))
    (len (string-length file-name))
    (png-comp (- 9 (div quality 12)))

   ) ; end variable definition

        (if (and (> len 0)
       (not (= 47 (aref file-name (- len 1)))) ;always true (maybe)
       (equal? (car (last (strbreakup file-name "/"))) "#"))
       (set! file-name (substring file-name 0 (- len 1))))

   (while (< count number)
     (let* (
            (tmp-image-type
              (cond
                ((and (eqv? save-type 0) (eqv? image-type 2))
                  0)      ;; convert to RGB because BMP can't treat INDEXED image
                ((and (eqv? save-type 1) (or (eqv? image-type 1) (eqv? image-type 2)))
                  0)      ;; convert to RGB because JPEG can't treat INDEXED and GRAY image
                (image-type)))   ;; otherwise, equal to origianl image type
            (layer (aref (cadr layers) (if (= reverse 1) count (- number 1 count))))
            (tmp-img (car (gimp-image-new (car (gimp-drawable-width  layer))
                                          (car (gimp-drawable-height layer))
                                          tmp-image-type)))
            (tmp-layer (car (gimp-layer-new tmp-img
                                            (car (gimp-drawable-width  layer))
                                            (car (gimp-drawable-height layer))
                                            (+ 1 (* 2 tmp-image-type)) "Temp Layer" 100 NORMAL)))
           )

   ;; create an image with single layer, and remove the layer mask (if exists)
       (gimp-image-add-layer tmp-img tmp-layer 0)
       (gimp-edit-copy layer)
       (gimp-floating-sel-anchor (car (gimp-edit-paste tmp-layer 0)))
       (if (< 0 (car (gimp-layer-mask layer)))
         (let* ((tmp-mask (car (gimp-layer-create-mask tmp-layer 0))))
           (gimp-edit-copy (car (gimp-layer-mask layer)))
           (gimp-floating-sel-anchor (car (gimp-edit-paste tmp-layer 0)))
           (gimp-image-remove-layer-mask tmp-img tmp-layer APPLY)
           (gimp-displays-flush)))
       ;(set! tmp-display (car (gimp-display-new tmp-img)))
       ;(gimp-displays-flush)

   ;; save a resulting image by specified image type
       (cond
         ((eqv? save-type 0)
           (to-save-bmp tmp-img tmp-layer (gen-name count ".bmp")))
         ((eqv? save-type 1)
           (to-save-jpg tmp-img tmp-layer (gen-name count ".jpg") quality))
         ((eqv? save-type 2)
           (to-save-png tmp-img tmp-layer (gen-name count ".png") png-comp))
              ((eqv? save-type 3)
           (to-save-tif tmp-img tmp-layer (gen-name count ".tif")))
       )
       (gimp-image-delete tmp-img)
       ;(gimp-display-delete tmp-display)
     )
     (set! count (+ count 1))
   ) ;; repeat until all layer is saved
  )
)

(script-fu-register
   "script-fu-continuous-save"
   "<Image>/Script-Fu/Utils/Continuous Save..."
   "Save an Image by single layer with continuous number"
   "@hk, originals: Tamubun <http://bunysmc.exblog.jp/>, Original: Iccii <iccii@hotmail.com>"
   "Iccii"
   "May, 2005"
   "RGB* INDEXED* GRAY*"
   SF-IMAGE   "Image"         0
   SF-DRAWABLE   "Drawable"      0
   SF-OPTION   "Saved File Type"   '("BMP" "JPG" "PNG" "TIF")
   SF-FILENAME   "Base File Name"   "MyPicture_"
   SF-ADJUSTMENT   "Digits"      '(8 1 10 1 5 0 1)
   SF-ADJUSTMENT   "Start Number"      '(1 1 9999999 10 5 0 1)
   SF-TOGGLE   "Reverse Order"      FALSE
   SF-ADJUSTMENT   "Quality"           '(75 0 100 1 5 0 0)
)
 
WERBUNG
Zurück
Oben Unten