Adding multiple images to a background image
Posted: 2008-06-14T05:25:36-07:00
Hi and thanks for taking the time read this, I am trying to add multiple images to a background image, I have this working fine if I do each image to be added one at a time, but that means running the command serveral times in order for it to work, I was hoping to do it all in one command but I get a bit of a mess as a result.
Here is the code I have tried to use but it just doesnt work, the images all see to be in the same place.
basicaly its opening the output file ( the background image) adding an icon image to it and saving it as output, overwriting the original output, then move onto the next image to add and then the next etc, at least thats the effect im looking for.
there are no effects added to the images they are simply placed on the output image in the correct position using the -geometry +?+?, very similar to what adobe photoshop would do via layers.
I have looked at god knows how many examples to do this but im just not getting it to work using one command like above, however it does work if I do each image serperate like below.
could anyone pleae tell me where im going wrong? ive been at this for over 2 days now and i have looked at god knows how many examples and posts but no joy, so have asked for help as a last resort (cos im just not getting anywhere)
any help appriciated
regards
Here is the code I have tried to use but it just doesnt work, the images all see to be in the same place.
Code: Select all
$command = $imageMagickPath."composite -geometry +16+1 {$mainPath}{$clock} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +1+1 {$mainPath}{$signal1} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +224+1 {$mainPath}{$signal2} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +5+82 {$mainPath}{$icon_select} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +7+83 {$mainPath}{$icon1} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +45+83 {$mainPath}{$icon2} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +82+83 {$mainPath}{$icon3} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +122+83 {$mainPath}{$icon4} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +160+83 {$mainPath}{$icon5} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +200+83 {$mainPath}{$icon6} {$mainPath}{$output} {$mainPath}{$output} "
." composite -geometry +7+130 {$mainPath}{$icon7} {$mainPath}{$output} {$mainPath}{$output}";
exec($command);
there are no effects added to the images they are simply placed on the output image in the correct position using the -geometry +?+?, very similar to what adobe photoshop would do via layers.
I have looked at god knows how many examples to do this but im just not getting it to work using one command like above, however it does work if I do each image serperate like below.
Code: Select all
// add the clock
$command = $imageMagickPath."composite -geometry +16+1 "
." {$mainPath}{$clock} {$mainPath}{$output} {$mainPath}{$output}";
exec($command);
// add the signal strenghs
$command = $imageMagickPath."composite -geometry +1+1 "
." {$mainPath}{$signal1} {$mainPath}{$output} {$mainPath}{$output}";
exec($command);
$command = $imageMagickPath."composite -geometry +224+1 "
." {$mainPath}{$signal2} {$mainPath}{$output} {$mainPath}{$output}";
exec($command);
etc etc
any help appriciated
regards