Page 1 of 1
overlay two postscript images (topic changed)
Posted: 2007-12-20T15:55:19-07:00
by wilky
Hi
I am brand new to IM. here is what I did:
I have two tiff files, one is my signature, the other is a form. so i wanted to put the signature at the bottom of the form. The command I use:
convert -combine signature.tiff form.tiff output.tiff
what happend to the output file is the alignment is ok, the signature is in the right position. But the color totally changed, it supposed to be simple black and white, but what i got is black background, green form and red signature.
I suspect it's something to do with the layer, anyone can help me to solve this issue?
many thanks
wilky
Re: wierd problem combine two tiff combination
Posted: 2007-12-20T18:09:39-07:00
by anthony
The -combine operator is used to combine grayscale color channel images! it is NOT for overlaying images. Your command would have taken the first image as a Red color channel, the second as a green color channel and a missing 'null:' image (black) as the blue color channel. the result -- A Mess!
Also you are relying on a obsolete legacy system by specifying an image
operator before actually reading any images into the the current (default) image sequence.
If you have two grey images you with use Alpha Composition to overlay them.
either the default '
Over' if the source image is transparent. Or '
Screen' if they have white backgrounds or '
Multiply' if they have black backgrounds.
See
IM Examples, Alpha Composition
For example assuming they have white backgrounds..
Code: Select all
convert form.tiff signature.tiff -compose screen -composite output.tiff
Positions of the signature can be adjusted using a
-geometry setting just before the
-composite operator.
Re: wierd problem combine two tiff combination
Posted: 2007-12-21T10:00:05-07:00
by wilky
Hi Anthony
Thanks for the quick reply,it really helped explain the question.
when I read your link and tried the command you gave out, but i got
convert: unrecognized option `-composite'
i checked into man page of convert, it doesn't have the composite option.
am i using the wrong IM version? my version is 6.0.7
thanks a lot
wilky
Re: wierd problem combine two tiff combination
Posted: 2007-12-21T11:16:25-07:00
by Bonzo
6.0.7 is quite an old version now; I am using 6.3.7 are you using php as that seems to be the standard version with php version 4. something ? I think it is one of the default versions on some Linux installations.
If you are using php you can use this code to find out a lot about your IM setup:
Code: Select all
<?php
// Build the array of items to be used
exec("convert convert -list list", $IMarray, $code);
// Start the loop to find and display the results
foreach ($IMarray as $value) {
echo "<br>system (\"convert -list $value\")";
echo "<pre>";
system("convert -list $value");
echo "</pre><hr>";
}
?>
You could try this and see if composite is in there:
Re: wierd problem combine two tiff combination
Posted: 2007-12-23T04:47:09-07:00
by anthony
In your version -compose {method} is probably the operator.
The -composite operator was added, so that -compose {method} can be made a setting rather than a directly applied operation. This was needed so that the composition method it sets can be used by other operators like -flatten, -boarder and -frame.
Re: wierd problem combine two tiff combination
Posted: 2007-12-28T10:15:52-07:00
by wilky
Hi Anthony:
I tried -compose and it gave me a blank page.
so I decided to upgrade my IM, my Linux version is RH EPS4, I uninstalled IM6.0.7 from RPM and installed a fresh 6.3.7 from tar ball under /usr/IM637, now everytime I try to run the display command, instead of giving me a display screen, system returns the display help info, what goes wrong?
I also downloaded the 6.3.7 rpm package from rpmfind.net, but I got this when do the installation:
1:ImageMagick warning: user cristy does not exist - using root
warning: group cristy does not exist - using root
########################################### [100%]
warning: user cristy does not exist - using root
warning: group cristy does not exist - using root
So do I have to create a user and group with the name Cristy?
Sorry for being dumb here and many thanks for your help
Wilky
Re: wierd problem combine two tiff combination
Posted: 2008-01-01T18:06:55-07:00
by anthony
You can ignore the cristy errors.
As for the other problem. I am not certain, a pure white result is definately not correct.
Can you give the exact commands you tried?
Re: wierd problem combine two tiff combination
Posted: 2008-01-02T15:46:49-07:00
by wilky
Hi Antony, thx for the response.
this is the command i tried:
convert form.tiff signature.tiff -compose overlay output.tiff
I also use:
composite form.tiff signature.tiff -compose overlay output.tiff
My original question has also changed a bit, instead of overlay two tiff files, form.tiff actually need to be postscript file and it contains some arguments so that the output.tiff can be used in fax, can I still do this with IM?
Happy New Yr
Wilky
Re: wierd problem combine two tiff combination
Posted: 2008-01-02T19:09:31-07:00
by anthony
Should be able to though you may like to add -density and optionally -page size options.
Re: wierd problem combine two tiff combination
Posted: 2008-01-08T10:03:27-07:00
by wilky
Hi Anthony:
Been playing around with convert for a while, didn't get any luck. so go back to very beginning, i am trying to upgrade my IM to the newest version as suggested, after the installation from tar ball, convert and identify work fine, but display doesn't show anything, it only returns bunches of display command help information.
IM 6.3.7
Linux rhel 4
DISPLAY is set
any suggestions?
many thanks
wilky
Re: overlay two postscript images (topic changed)
Posted: 2008-01-08T18:45:40-07:00
by anthony
For that no. sorry. presumably the display arguments are wrong in some way.