Page 1 of 3

Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T10:13:45-07:00
by MADubs
My business entails generating tiffs (many/day) from Adobe Illustrator files and IM has been a godsend for me after the pain of using Photoshop to rasterize all my AIs. But I just hit a roadblock as I find out that my PC-using customers are losing the color fidelity of the tiffs when they drop them into any MS Office document (oddly, this is not an issue with Office 2013, but virtually none of my customers are that up to date). By "losing the color fidelity", I mean the image background turns bright neon green and all the colored shapes turn black. Please, please, please tell me there is a solution to this. My clients need to be able to move their tiffs into word documents occasionally and into PowerPoint slides often for presentation purposes. If I can't solve this issue, using IM to rasterize will become untenable.

Here's my standard code:

mogrify -format tif -depth 8 -density 1200 -flatten -compress lzw *.ai

Just as an example:
Here are the links to the IM tiff, and PS tiff, and .ai file, respectively:
https://app.box.com/s/9dzaw63altfetdy7k37q
https://app.box.com/s/da9an59yulbnchzgrrih
https://app.box.com/s/icwny5lzebknx5rq3wxl.

Note that you will likely not be able to replicate the issue on a Mac or PC running Office 2013.

I would greatly appreciate any help or insight!

Thanks,
Michele

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T10:38:01-07:00
by MADubs
By the way, I do see that this has been discussed in viewtopic.php?t=20530, but I have not had success applying the solution to my code.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T11:00:34-07:00
by snibgo
FQ68DTFT_Fig2.tif contains unassociated alpha. This is normally used for masking, but may complicate the situation. I suggest you remove it, with "-alpha off".

"identify -verbose" shows a number of other differences, including PhotometricInterpretation. The PS version contains a profile, although I doubt that is an issue.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T11:10:56-07:00
by MADubs
Thanks for the response. I just tried

mogrify -format tif -alpha off -depth 8 -density 1200 -flatten -compress lzw *.ai

and got the same result...bright green background in Word. Did I place the -alpha off correctly?

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T11:25:07-07:00
by snibgo
I don't use mogrify, sorry. "identify -verbose" will tell you if the result has an alpha channel.

The IM file is also grayscale, where the PS file is RGB. Try "-type truecolor" in the command.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T11:26:59-07:00
by MADubs
Some progress: When I remove -flatten from the original code, the image inverts in Word so that the background is white, but any color becomes lime green...

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T11:28:30-07:00
by MADubs
I used mogrify mainly because I usually do batches, but it is the same story with convert. I will try -type truecolor now without flatten. Thanks!

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T12:17:56-07:00
by fmw42
I downloaded your ai.ps file and converted it using IM 6.8.9.10 Q16 Mac OSX as

Code: Select all

convert FQ68DTFT_Fig2.ai.ps -depth 8 -background white -flatten tmp1.tif
Then opened it in PS (CS very old) and it said it was grayscale.

Then I opened Word 2008 (Mac) and copied and pasted your image into it. It looked fine. No green.

Are you using the latest version of IM and libtiff and Ghostscript?

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T12:22:52-07:00
by MADubs
Yeah, the issue does not replicate on my Mac or when I'm running Office 2013 in Windows 7 in Parallels. But when I run it on Office 2010 on my PC, bam, green. I believe I am running the latest version of IM, but I don't know about libtiff; how can I check this? Sorry for the remedial question.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T12:25:17-07:00
by MADubs
Running 6.8.9-1; can you instruct me on how to update libtiff?

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T12:54:24-07:00
by fmw42
I am on a Mac. I get all my delegates from MacPorts. But I install IM from source manually. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202

To check your version of libtiff, type in a terminal window

convert -list format

and see what it says for TIFF. Mine shows:

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.3)


For Ghostscript, I type the following in the terminal window

gs --version
9.10


If you need to upgrade those, then you can do as I do above using MacPorts and then recompile IM. Or perhaps just download IM from MacPorts. It should have the most up to date delegates pre-installed.

I do not know how to do it on Windows, but one of the other users can probably help.

You can search on Google to find the Tiff and Ghostscript web sites and download the delegates from there. IM has a list of links to delegates at http://www.imagemagick.org/download/delegates/, which should be reasonably up to date.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T13:12:14-07:00
by MADubs
Thank you. I installed IM using MacPorts I believe. Here's what I've got:

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.3)
TIFF64* TIFF rw- Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)

gs --version : 9.10

At this point, I believe this has something to do with the alpha channel, though I've exhausted all the commands for -alpha to no avail. The problem persists. It's interesting that the problem does not appear in Office 2013, which tells me it is definitely a MS weirdness, but I feel like if PS can create tiffs that are rendered fine in Word 2007, IM ought to be able to replicate that.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T14:11:10-07:00
by fmw42
Adobe does not play fair with Tiffs. They put in special hidden data. Also other uses of Tiff can modify it to customize to their own uses. So tiff is not a terribly reliable format.

So clarify this. It works in your Office 2013, but not in Office 2010. But it works for me in Office 2008. Is that correct?

Did you open the ai file in PS and convert to tiff and then try to put it into Office 2013 and 2010? Does that work? But it does not work if IM converts the ai.ps file? What is the file? Is it ai or ps? The download shows it as ai.ps, so it is interpreted as a ps file and not ai? Is there a problem with your upload that converts from ai to ps?

How did you put it into Office/Word? I opened the file in Preview, then copied it and pasted into Word? Did you use a different means of getting it into Word?

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T15:33:43-07:00
by MADubs
So clarify this. It works in your Office 2013, but not in Office 2010. But it works for me in Office 2008. Is that correct?
Correct. On a PC, it will work in Office 2013 but not previous versions. On a Mac, as far as I know, it will work in any version.
Did you open the ai file in PS and convert to tiff and then try to put it into Office 2013 and 2010? Does that work? But it does not work if IM converts the ai.ps file? What is the file? Is it ai or ps? The download shows it as ai.ps, so it is interpreted as a ps file and not ai? Is there a problem with your upload that converts from ai to ps?
If I convert the ai file to a tiff in PS, it will work just fine. If I resave the tiff as a tiff in PS, it will work just fine also. The problem only arises when I convert ai to tif in IM. The file the file is an .ai file. I'm not sure why you are seeing ps in there..that is strange. That may be some issue with the upload I suppose, but I will try again.
How did you put it into Office/Word? I opened the file in Preview, then copied it and pasted into Word? Did you use a different means of getting it into Word?
When I drag and drop or insert the file into the word or ppt document, it shows up green. However, if I open it in Paint and then copy/paste it, it looks as it should except humongous and needs to be scaled down dramatically. This is a possible work around for my clients, but I don't want to create extra work for them. It is odd, though, that opening in Paint seems to eliminate the rendering issue.

Re: Ack! IM Tiffs turn bright green when dropped into Word

Posted: 2014-11-12T15:36:36-07:00
by MADubs
So you're saying that https://app.box.com/s/icwny5lzebknx5rq3wxl opens as .ai.ps? For me it is just downloading as .ai. That's very odd.