Page 1 of 1
Combine 14 images into one
Posted: 2013-10-12T17:02:35-07:00
by jtheg
Hello,
I have tried finding a solution to this on my own but i cant work it out im really sorry to bother you guys with this,
I have 14 transparent png files that are dynamicly generated,
i want to fetch all of them from their url with imageMagick and combine them into just 1 jpeg image,
I am using the commandline for the imageMagick on a Linux Debian server,
each of the dynamic images are all very small in size,
Thanks in advance,
J.
Re: Combine 14 images into one
Posted: 2013-10-12T17:12:17-07:00
by fmw42
try (Unix syntax)
convert "
http://www.somedomain.com/...image1.png" \
"
http://www.somedomain.com/...image2.png" \
...
"
http://www.somedomain.com/...image14.png" \
-background whatevercolor -flatten result.jpg
be sure that the path to the files and filenames have no spaces or include the http (url) code for a space %20;
for windows use ^ rather than \ for new line indicator
Re: Combine 14 images into one
Posted: 2013-10-12T17:21:15-07:00
by jtheg
Re: Combine 14 images into one
Posted: 2013-10-12T17:22:52-07:00
by fmw42
Yes. But you can remove all the \ and put them all on one long line if you want.
Of course replace my generic web file paths with your specific ones and pick a background color since jpg does not support transparency.
P.S try just one file and see if it works before you try 14. That way you find out if you have permissions to download from that web site.
Re: Combine 14 images into one
Posted: 2013-10-12T17:27:05-07:00
by jtheg
I think i sort of have it working,
The images have dynamic parameters after them and i dont think the command line likes it ,
Any ideas?
EDIT: I tried adding quotes around the url but then i get,
error : Unknown IO error
Segmentation fault
Re: Combine 14 images into one
Posted: 2013-10-12T18:32:35-07:00
by fmw42
[quote="jtheg"]I think i sort of have it working,
The images have dynamic parameters after them and i dont think the command line likes it ,
Any ideas?
No, not really. I am not sure IM can handle the dynamic parameters in a URL. I suspect it needs a simple URL.
But if you want to provide me a link to one image, I can try to test it myself.
Re: Combine 14 images into one
Posted: 2013-10-13T08:15:54-07:00
by snibgo
URLs with parameters like
http://domain/file?param=x often need to be quoted eg "
http://domain/file?param=x" in Windows.
Re: Combine 14 images into one
Posted: 2013-10-14T17:13:56-07:00
by anthony
It is likely the security is objecting to the wildcards in the URL.
IM can handle simple URL's but more complex ones are better handled by soemthign like wget.
Hmmm try a bit of shell scrtipting...
Code: Select all
cat url_list.txt
while read url; do
wget -q -O - "$url" | convert png:- miff:-
done | convert - -background white -flatten result.jpg
Note I convert the PNG to MIFF format as this is a 'streaming' format. That is you can just concatante images one after the other in the stream and Im will handle reading ALL the images from the stream fine.
There has been a push to try and allow IM to read some image file formats using image streams (such as PNG), and even to just read one image from a stream, while leaving the stream open so another image can be read later by the same (or different) command. That however required the ability to not 'read-ahead' or use 'EOF' to mark the end of an image file (so TXT: images when has not 'end of image' marker in the format is no good for this).