Compose an image from multiple images

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jmituzas
Posts: 18
Joined: 2011-02-17T12:29:20-07:00
Authentication code: 8675308

Compose an image from multiple images

Post by jmituzas »

I have been trying this for the most of the day and I can not figure this out.

I want to compose a single image with multiple images. Something along the lines of:

Code: Select all

convert -transparent white -size 360x140 label:'this is a test for a url' test1.png
convert -transparent white -size 360x140 label:'this is a test for a spanish url' test2.png
convert -transparent white -size 360x140 label:'this is a test for a text-logo' test3.png

composite test1.png -gravity East -geometry +200-100 / 
composite test2.png -gravity North -geometry +200-100 /
composite test3.png -gravity West -geometry +200-100 -density 350 test.pdf output.pdf


here's what I get composite: no decode delegate for this image format `/' @ error/constitute.c/ReadImage/532.

So question is how do I accomplish this?

Thanks in Advance,
Joe
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Compose an image from multiple images

Post by Bonzo »

This will work Joe just modify it to what you want:

Code: Select all

convert -size 360x140 -background none label:'this is a test for a url' test1.png
convert -size 360x140 -background none label:'this is a test for a spanish url' test2.png
convert -size 360x140 -background none label:'this is a test for a text-logo' test3.png

convert -size 500x500 xc:white test1.png -gravity East -composite test2.png -gravity North -composite test3.png -gravity West -composite -density 350 output.pdf
jmituzas
Posts: 18
Joined: 2011-02-17T12:29:20-07:00
Authentication code: 8675308

Re: Compose an image from multiple images

Post by jmituzas »

Yours worked but not quite.

OK maybe I should start over and fill you in on what I am trying to do exactly.

Ok I have 3 images:
- url test1.png
- spanish url test2.png
- logo test3.png

these 3 images have to be placed into a .pdf that already exists we will call this test.pdf

After all these images are in place it will create a new document called output.pdf.

Your works for creating a pdf w/ just the tests how can I get it to work with an existing .pdf?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Compose an image from multiple images

Post by Bonzo »

Code: Select all

convert -size 360x140 -background none label:'this is a test for a url' test1.png
convert -size 360x140 -background none label:'this is a test for a spanish url' test2.png
convert -size 360x140 -background none label:'this is a test for a text-logo' test3.png

convert test.pdf test1.png -gravity East -composite test2.png -gravity North -composite test3.png -gravity West -composite -density 350 output.pdf
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Compose an image from multiple images

Post by anthony »

jmituzas wrote:After all these images are in place it will create a new document called output.pdf.

Your works for creating a pdf w/ just the tests how can I get it to work with an existing .pdf?
PDF to PDF is not recommended with Image Magick.

PDF is a vector image (draw lines and text) file format, and Imagemagick is a raster (pixel array) image processor.

See A word about Vector Image formats.
http://www.imagemagick.org/Usage/formats/#vector
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jmituzas
Posts: 18
Joined: 2011-02-17T12:29:20-07:00
Authentication code: 8675308

Re: Compose an image from multiple images

Post by jmituzas »

anthony wrote: PDF to PDF is not recommended with Image Magick.

PDF is a vector image (draw lines and text) file format, and Imagemagick is a raster (pixel array) image processor.

See A word about Vector Image formats.
http://www.imagemagick.org/Usage/formats/#vector
So you are telling me this can not be done?

I understand that but, it looks pretty good (-density 350) but can only get it to compose one image.
When I try to add another one to the output of that is when it looses its clarity, well not really looses it color.

So (weather recommended or not), how would I get it to compose all 3 images at the same time? All in different locations onto a single page pdf.

If this can not be done as a pdf can someone help me out with the conversion from .png to a full page pdf?

Thanks in advance,
Joe
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Compose an image from multiple images

Post by Bonzo »

Did you try my second example code ?
jmituzas
Posts: 18
Joined: 2011-02-17T12:29:20-07:00
Authentication code: 8675308

Re: Compose an image from multiple images

Post by jmituzas »

Bonzo wrote:Did you try my second example code ?
It Works!

Just one more thing, how can I make it full page.. its really small.
Post Reply