overlay two postscript images (topic changed)
overlay two postscript images (topic changed)
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
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
Last edited by wilky on 2008-01-08T10:06:03-07:00, edited 1 time in total.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: wierd problem combine two tiff combination
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..
Positions of the signature can be adjusted using a -geometry setting just before the -composite operator.
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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: wierd problem combine two tiff combination
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
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
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:
You could try this and see if composite is in there:
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>";
}
?>
Code: Select all
convert -list Command
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: wierd problem combine two tiff combination
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: wierd problem combine two tiff combination
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
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
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: wierd problem combine two tiff combination
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?
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?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: wierd problem combine two tiff combination
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
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
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: wierd problem combine two tiff combination
Should be able to though you may like to add -density and optionally -page size options.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: wierd problem combine two tiff combination
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
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
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: overlay two postscript images (topic changed)
For that no. sorry. presumably the display arguments are wrong in some way.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/