DstOver w transparent tif issue in PS

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
sorno
Posts: 3
Joined: 2015-06-11T20:15:07-07:00
Authentication code: 6789

DstOver w transparent tif issue in PS

Post by sorno »

Hi all.
I have two tif files that i am compositing using DstOver.
One has transparency and one does not.

This appears to work perfectly when I preview and print the images just using the preview tool in windows.

composite -compose Dst_Over -gravity center "src_image.tif" "dst_image_trans.tif" -colorspace RGB "new_output.tif"

However when I open in PS, only dst_image_trans.tif can be seen. The src_image that was to be under it is gone.
There is only one layer showing, layer1, with the dst_image, and the transparency is there.
I have tried additional convert commands for -flatten and -layers flatten, but neither change the file.

Any ideas?
Files here https://www.dropbox.com/s/tsv02lf646c0h ... g.zip?dl=0
Using windows, im version 6.9.1-4
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: DstOver w transparent tif issue in PS

Post by fmw42 »

It appears that there is some meta data that is causing this. It works for me if I strip both images of meta data and use the more current IM syntax on IM 6.9.1.4 Q16 Mac OSX and (a very old) PS CS. The result when opened in PS is one layer with a transparent alpha channel.

Code: Select all

convert dst_image_trans.tif src_image.tif -strip -gravity center -compose dst_over -composite out.tif
Note the swapping of the image order between your command and mine. See http://www.imagemagick.org/Usage/compose/#compose

I am puzzled why you want to change the colorspace to linear RGB rather than the default sRGB. You might be better assigning a profile after the end since the meta data has been stripped.

You can try removing each profile in the original images one at a time to see which one is the offending one.
sorno
Posts: 3
Joined: 2015-06-11T20:15:07-07:00
Authentication code: 6789

Re: DstOver w transparent tif issue in PS

Post by sorno »

Hi guys figured this out.
I created an alpha channel for the transparent area and saved the file in PS with no layers, but with alpha channel, and then set the composite to -alpha set. Works!
like this
composite -alpha set -compose Dst_Over -gravity center "src_image.tif" "dst_image_trans.tif" -colorspace RGB "new_output.tif"
Post Reply