Page 1 of 1

Difference between composite and convert -composite BUG??

Posted: 2016-10-20T08:10:39-07:00
by jansuhr
When using the command composite to save a transparent Photoshop file I get a different result than with convert -composite.

With composite I get the proper result of a PSD file with a transparent background.
The command is:

Code: Select all

composite input.jpg transparent_file.tif mask.jpg output.psd
Only drawback with the above is that the clipping path in the input file is discarded and so is the embedded ICC-Profile and both are needed in the final output file.

So trying with:

Code: Select all

convert -composite input.jpg transparent_file.tif mask.jpg output.psd
This doesn't give me a transparent background but the ICC-profile and clipping path are there.

Isn't these two commands supposed to have the same behavior??

Is this a bug??


Thanks

Jan

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T08:54:54-07:00
by snibgo
jansuhr wrote:Isn't these two commands supposed to have the same behavior??
No. For one thing, the input files (so-called "source" and "destination") are given in the opposite order. So if you want the same effect, you should swap the files.

You should also put operations (eg "-composite") after the inputs, not before. Thus:

Code: Select all

convert transparent_file.tif input.jpg mask.jpg -composite output.psd

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T09:08:42-07:00
by jansuhr
Thanks for the clarification, my mistake.

How ever doing it like you suggest discards the ICC-profile and the Clipping path, shouldn't they stay?
Another thing is that it shows that the resolution is only 1 px per inch.

Jan

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T09:17:53-07:00
by snibgo
Which file contains the profile? If transparent_file.tif then, yes, it should stay. I don't know what happens to clip paths, but I think that is the same. What resolution does that file have?

Generally, output metadata comes from the first input file. You can invert the order with a suitable "-compose", of course.

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T09:22:09-07:00
by jansuhr
Well if it the transparent file that controls this then it explains it. It is created on the fly with ImageMagick to get the same size as the original file. It doesn't contain any ICC-profile or paths and I guess that also explains the resolution.

Is there a way to copy the path from the input file and then paste it in to the output file? The ICC-profile can easily be assigned afterwards but the path has to be in the final output file!

Thanks

Jan

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T09:30:46-07:00
by snibgo
You can invert the order with a suitable "-compose":

Code: Select all

convert mask.jpg transparent_file.tif input.jpg -compose DstOver -composite output.psd

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T10:04:43-07:00
by jansuhr
That only gave me the mask in the output.

The solution you suggested in the my other post is working and could may be improved a little.

Jan

Re: Difference between composite and convert -composite BUG??

Posted: 2016-10-20T10:26:59-07:00
by snibgo
Yes, sorry, you want transparent, than input, then mask.