سؤال

لدي سلسلة من .xcf الصور التي أريد حفظها باسم .بي إن جي.يمكنني فتح كل ملف وحفظه باسم .بي إن جي ولكن نظرًا لوجود الكثير من الصور، فسيستغرق الأمر وقتًا لا بأس به.

هل هناك طريقة لتحويل جميع الصور مرة واحدة، أو طريقة أخرى يجب علي قضاء وقت أقل في هذه المهمة؟

شكرا لكم مقدما.

لا يوجد حل صحيح

نصائح أخرى

كنت أستخدم وحدة تحكم Python داخل GIMP لذلك - إذا حدثت في Windows، إلقاء نظرة على كيفية تثبيت ملحق Python ل Gimp 2.6 (على Linux، فإن إما يأتي ISNALLED أو هو مسألة تثبيتحزمة GIMP-PYTHON، وربما نفس الشيء على نظام التشغيل Mac)

من داخل وحدة التحكم Python في Gimp's، يمكنك الوصول إلى API GIMP Huge Gimp يمكنك التحقق من خلال النظر في مربع حوار "مستعرض إجراءات" المساعدة - إلى جانب وجود جميع ميزات Python الأخرى، بما في ذلك الملفات والمعالجة المتشددة.

واحد أنت= في وحدة التحكم Python-Fu، فمن المسألة القيام بشيء مثل هذا: giveacodicetagpre.

(سيعمل هذا على الدليل يستخدمه GIMP كإخلاء افتراضي - قم بتسلغ الدليل Desriied إلى FilePaths للعمل على مؤسسات أخرى).

إذا كنت بحاجة إلى ذلك أكثر من مرة، إلقاء نظرة على إضافات المثال التي تأتي مع GIMP-PYTHON، ولصق التعليمات البرمجية أعلاه باعتبارها Core Fo Python Plug-in for Gimp للحصول على استخدامك الخاص.

حسنا إذا كان لديك imagemagick المثبتة، يمكنك القيام بذلك مثل:

mogrify -format png *.xcf

يؤدي هذا إلى تحويلها تلقائيًا في نفس الدليل.اقرأ أيضا man mogrify أو هذا لخيارات أخرى.

يمكنك بسرعة إنشاء البرنامج المساعد يسمى SaveAll.حفظ هذا الرمز إلى بعض الملفات مع .scm امتداد (مثلا ، saveall.scm):

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
; 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 (script-fu-save-all-images) 
  (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-get-active-layer image)) 
                      (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-all-images" 
 "<Image>/File/Save ALL" 
 "Save all opened images" 
 "Saul Goode" 
 "Saul Goode" 
 "11/21/2006" 
 "" 
 ) 

ضع الملف في مجلد الإضافات مع نفس امتداد (على ويندوز انها C:\Program Files\GIMP 2\share\gimp\2.0\scripts).

ثم أنت حتى لا تضطر إلى إعادة تشغيل التطبيق. المرشحات القائمة -> Script-Fu -> تحديث البرامج النصية.عليك حفظ جميع البند في الملف القائمة (في الأسفل).يعمل سريعة سهلة بالنسبة لي.

هذا السيناريو يأتي من هنا.

هناك أيضا آخر السيناريو ، ولكن لم أجربها بنفسي

giveacodicetagpre.

يعمل هذا البرنامج النصي بشكل مثالي في gimp 2.8 ويندوز 7.

UCHLIN WILKINSON احفظ جميع الصور المفتوحة من برنامج جيمب.

يكون هذا مفيدًا إذا كنت تقوم بالمسح الضوئي لعدد كبير من الصور وتريد فقط تصديرها جميعًا دفعة واحدة.وهو يعتمد على برنامج نصي من تأليف Saul Goode، ممتد ليطلب اسم قاعدة الصورة والدليل وما إلى ذلك.

احفظه باسم saveall.scm في دليل البرامج النصية لـ Gimp.على سبيل المثال~/.gimp-2.8/scripts/

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 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 (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 ) ".jpg" )
        (( equal? inSaveType 1 ) ".bmp" )
        (( equal? inSaveType 2 ) ".png" )
        (( 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>/File/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 "jpg" "bmp" "png" "tif")
 SF-STRING     "Save File Base Name" "IMAGE"
 SF-ADJUSTMENT "Save File Start Number" 
      (list 0 0 9000 1 100 0 SF-SPINNER)
 )
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top