It is currently Thu Apr 25, 2024 12:03 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Automatic loading layers from a file
PostPosted: Sat Oct 18, 2014 12:58 am  (#1) 
Offline
New Member

Joined: Oct 18, 2014
Posts: 2
What function or script, you can boot from the layers?
Now to get the layers, you must manually select the desired files while holding ctrl.
I need to do so to be able to point to a file (for example green.txt), which formed the names of the files necessary to me (green_01_01.xcf green_02_01.xcf green_01_07.xcf green_01_010.xcf, etc.) as a result of that-be being downloaded data files as layers.
Perhaps there is another option, for example by copying this list, insert into some command line.
Thanks for the tips.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Automatic loading layers from a file
PostPosted: Sat Oct 18, 2014 1:57 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
If the file can be grouped naturally (by name, date, size...) you can also sort the display accordingly, then:

- click on the top one
- shift-click the bottom one

This will select everything in between.

_________________
Image


Top
 Post subject: Re: Automatic loading layers from a file
PostPosted: Sat Oct 18, 2014 5:49 am  (#3) 
Offline
New Member

Joined: Oct 18, 2014
Posts: 2
ofnuts wrote:
If the file can be grouped naturally (by name, date, size...) you can also sort the display accordingly, then:
- click on the top one
- shift-click the bottom one
This will select everything in between.

No.
This method is not suitable.
The file (green.txt) is made automatic.
All the file names of future layers in this file are chosen randomly, so they can't be sorted with manual selection.


Top
 Post subject: Re: Automatic loading layers from a file
PostPosted: Sat Oct 18, 2014 8:43 am  (#4) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2424
This falls in category "throwing ideas around"

It might be possible with imagemagick (IM) in a batch file.

There are plenty of 'if-n-buts'
IM still does not handle xcf files very well. Better than it used to but so far I have not been able to preserve transparency when there is any, which also applies converting xcf to png with IM.

Same applies for outputing to a multilayer xcf file. However tif does work.

This is in linux but I suppose there are similar commands in Win.

#!/bin/bash
#
# list is the file with the list of files to combine, one per line
list=$1
#
# uses Imagemagick to stack the images to a new file multi.tiff
while read FILE; do convert "${FILE}" multi.tiff -type TrueColorAlpha multi.tiff ; done < "$1"
#
# opens multi.tiff in Gimp. there is a dialog to ok
gimp multi.tiff
#
# tidy up
rm multi.tiff


Very rough, throws up an error on the first iteration because multi.tiff does not yet exist, but does work.

looks like this http://i.imgur.com/xVXt75Q.jpg

_________________
Image


Last edited by rich2005 on Sat Oct 18, 2014 8:46 am, edited 1 time in total.

Top
 Post subject: Re: Automatic loading layers from a file
PostPosted: Sat Oct 18, 2014 8:44 am  (#5) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
If you are using a GNU/Linux operating system (with BASH), you can use the following invocation.
gimp -n -b - <<EOF
  (with-input-from-file "green.txt" (lambda ()
    (define (readln)
      (let loop ((char (read-char))
                       (result "") )
        (if (eof-object? char)
          (if (zero? (string-length result))
            #f
            result )
          (if (eqv? char #\newline)
            (if (zero? (string-length result))
              #f
              result )
            (loop (read-char) (string-append result (make-string 1 char))) ))))
    (let ((image (car (gimp-image-new 10 10 RGB))))
      (let file-loop ((filename (readln)))
        (when filename
          (let ((layer (catch #f (car (gimp-file-load-layer 1 image filename)))))
            (unless layer
              (set! layer (gimp-text-fontname image -1 0 0
                                              (string-append "Unable to load: "
                                                             filename)
                                                0 TRUE 12 PIXELS "Sans" )))
            (gimp-drawable-set-name layer filename)
            (gimp-image-insert-layer image layer 0 0) )
          (file-loop (readln)) ))
      (gimp-display-new image)
      (gimp-image-resize-to-layers image) )))
EOF


On Windows, one might have to create a .scm file and place it in their scripts folder.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Newbie alert: loading numbered files for G'MIC transformation

5

No new posts GIMP - my security software prevents it from loading - RESOLVED

6

No new posts Attachment(s) Font In Status Bar Not Loading Correctly (on top of other font issues)

4

No new posts "New"file replacing "open" file?

2

No new posts GIH FILE

2



* Login  



Powered by phpBB3 © phpBB Group