Page 1 of 1
Montage and save in layered psd
Posted: 2017-04-04T12:17:31-07:00
by ntho
Good evening
I'm pretty new to IM. I'm trying to use montage to create a image grid from multiple images. I'd like to export this image to a layered psd so I could change and edit some things after. I was able to save it to a psd but of course its just with one layer. Would it be possible to save each added image on the montage command as a different layer in a psd?
I'm using:
Code: Select all
montage $1/*.jpg -mode concatenate -geometry +10+10 -font Helvetica $GRID droplist_$TIMESTAMP.psd
Thanks in advance!
Re: Montage and save in layered psd
Posted: 2017-04-04T12:55:34-07:00
by fmw42
Not directly that I know. You would need to set the -tile argument and create a series of montages adding one image each time and saving to some intermediate format. Then you would need to set the first layer as the composite layer and then write all the images to the psd to get it as layers.
Alternately, use append in a series of operations and after each append write to intermediate format such as miff that will accumulate layers. The reorder to put the composite or final layer with all the images as the first layer and the rest as other layers and save as psd.
Perhaps someone else has a better idea.
Re: Montage and save in layered psd
Posted: 2017-04-04T13:04:31-07:00
by fmw42
P.S. Please always provide your IM version and platform, since syntax may differ especially if you need to script a loop.
Re: Montage and save in layered psd
Posted: 2017-04-04T13:07:19-07:00
by fmw42
Do you want to show only one image per layer or all successive images in each layer? In montage, you can use null: to represent an empty image.
Re: Montage and save in layered psd
Posted: 2017-04-04T14:33:59-07:00
by ntho
fmw42 wrote: ↑2017-04-04T13:07:19-07:00
Do you want to show only one image per layer or all successive images in each layer? In montage, you can use null: to represent an empty image.
I'd like that each added image in montage is one layer. But I guess thats too complicated to do?
Re: Montage and save in layered psd
Posted: 2017-04-04T15:42:09-07:00
by fmw42
Still not sure if you want each layer to have only one image or all successive images? And you never responded with your IM version and platform!
What is $GRID in your command?
Re: Montage and save in layered psd
Posted: 2017-04-04T16:24:53-07:00
by fmw42
If you are on a Unix-like system, you can use subshell processing to save up layer in a miff: file. Then write the miff file to psd. For example, if I have 4 images (that I will create first), then I can do the following:
# create 4 different images from the rose: image
Code: Select all
convert rose: rose0.png
convert rose: -rotate 90 rose1.png
convert rose: -rotate 180 rose2.png
convert rose: -rotate 270 rose3.png
# now process the 4 images into a layered psd
Code: Select all
arr=(rose0.png rose1.png rose2.png rose3.png)
(
for ((i=0; i<4; i++)); do
convert xc:none[70x46+0+0] xc:none[70x46+0+0] xc:none[70x46+0+0] ${arr[$i]} -insert $i miff:- | montage - -background none -tile x1 -geometry +10+10 miff:-
done
) | convert - \( -clone 0-3 -background none -layers merge +repage \) +insert rose_montage.psd
http://www.fmwconcepts.com/misc_tests/rose_montage.psd
or square up the xc:none images as:
Code: Select all
convert rose: rose0.png
convert rose: -rotate 90 rose1.png
convert rose: -rotate 180 rose2.png
convert rose: -rotate 270 rose3.png
arr=(rose0.png rose1.png rose2.png rose3.png)
(
for ((i=0; i<4; i++)); do
convert xc:none[70x70+0+0] xc:none[70x70+0+0] xc:none[70x70+0+0] ${arr[$i]} -insert $i miff:- | montage - -gravity northwest -background none -tile x1 -geometry +10+10 miff:-
done
) | convert - \( -clone 0-3 -background none -layers merge +repage \) +insert rose_montage2.psd
The parenthesis processing creates the PSD composite (first layer)
Re: Montage and save in layered psd
Posted: 2017-04-04T16:28:11-07:00
by snibgo
ntho wrote:I'd like that each added image in montage is one layer. But I guess thats too complicated to do?
Complication isn't the problem. "montage" makes a single raster image. You want multiple raster images. "Montage" doesn't do that.
You can, as Fred says, replicate the action of "montage" by various methods.
Re: Montage and save in layered psd
Posted: 2017-04-04T16:40:52-07:00
by fmw42
If you cannot do the subshell processing, then you can simple composite the images in a loop into a full size background image in their proper locations writing each result to disk. Then take all the images and write them to psd.