Ack! IM Tiffs turn bright green when dropped into Word

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?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

It downloads for me with .ai.ps. I renamed the file to remove the .ps, so that it was just .ai.

I then repeated my command above using -background white -flatten to remove the alpha channel and leave a white background.

I then dragged the file from my desktop into PS (CS) and Word 2008 and it looked perfectly fine in both with white background. I also copied and pasted from PS to Word and it is still fine. I see no green anywhere.

My guess is that it has something to do with your clients versions of PS and Word. Maybe they are too old and have bugs. But that is just a guess.

A couple of suggestions.

1) Try creating the tiff with -compress none. Does that help?

2) Try adding -endian msb or lsb and see if either of those help?

see the -defines for Tiff at http://www.imagemagick.org/script/formats.php
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

I see one minor bug in IM. It is leaving an opaque alpha channel after flattening. There should be no alpha channel afterwards. So add -alpha off to the command and see if that helps.

Code: Select all

convert FQ68DTFT_Fig2.ai -depth 8 -background white -flatten -compress lzw -alpha off tmp1.tif
Or try turning off the alpha from the ai image by

Code: Select all

convert FQ68DTFT_Fig2.ai -alpha off -compress lzw -depth 8  tmp1.tif
Or

Code: Select all

convert -background white FQ68DTFT_Fig2.ai -alpha off -compress lzw -depth 8  tmp1.tif
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

Great! I will try all of those suggestions when I'm back at the office and have a PC to test it on. I'm pretty sure that you're not seeing any green because you're working on a Mac, right? On my Mac, there are no problems at all with green...I can't even replicate the problem unless I'm running Office 2010 on a PC. Thank you so much for your suggestions. I'll let you know tomorrow if any of these solve the problem.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

Paint saves images that have no colours as TIF RGB, not TIF Grayscale. So, have you tried my suggestion of "-type truecolor"?
snibgo's IM pages: im.snibgo.com
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

For the record, I did try every -alpha command there is earlier today, including -alpha off, to no avail...
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

I did try -type truecolor and a bunch of other -type commands and none of them fixed the problem or changed the way the image appeared in Word. The only thing that even came close was removing "-flatten" from my original code. This resulted in a white background but the *lines* in the image were now lime green.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Perhaps Word does not like grayscale images. You can test by adding one non-gray pixel at the top left and then using -type truecolor. In general, I do not think IM will convert grayscale images to RGB just by adding -type truecolor.

I would still add -alpha off to remove any possible opaque alpha channel.
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

I would add -alpha off to my code but it tends to result in some funky artifacts, particularly in black and white line-art that is saved at lower resolutions (under 1200 dpi). I should mention that I have tried this experiment with RGB images, both line art and photographs, with the same result...bizarre green coloring every time. Here's one such file to demonstrate my point: https://app.box.com/s/7nayhzpweqcg3j3jq0dy . Tomorrow I can show you what it looks like once converted to tiff in IM and dropped into Word.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

This works just fine for me in Word 2008.

Code: Select all

convert -density 300 Z352PFK7_Fig1.ai -alpha off -depth 8 -compress lzw Z352PFK7_Fig1.tif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

I compared your PS and IM TIFFs using identify -verbose info in IM and there are some differences.

Your PS file has type=grayscale, density 300, units pixelsperinch, rows per strip 89, no alpha channel, 8bim, xmp and sRGB profiles and strangely an an unspecified alpha:

tiff:alpha: unspecified
xmpTPg:HasVisibleOverprint: False
xmpTPg:HasVisibleTransparency: False


The IM file has type=grayscale alpha with a totally opaque (unassociated) alpha, density 1200, undefined units, rows per strip 1, and no profiles. PS may be hiding parameters in the 8bim or xmp profiles.

You should turn alpha off, set the same density and units and use the Tiff defines in IM to try to make the two as similar as possible and see if that helps.

You might also strip all the PS meta data from the PS tiff in IM and see if that still works when you put it over to Word.

You might also compare the two files using EXIFTOOL as it may be more accurate than IM in reporting (hidden) tiff specific parameters.
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

Was really hopeful that -endian lsb would work because you are the second person to suggest that, but the images are still green. Just to check...does the placement (order) in the code matter? I'm sort of randomly placing code. Here's how I added -endian:

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

Should that have applied the change?
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

Fred, didn't you say you are running a Mac? If so, I don't think you will ever see the green, so all the code will work fine for you, ya know? The problem only shows up in Office 2010 and older on a PC
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

So, here's what that ai looks like converted to a tiff in IM and dropped intoWord 2010: https://app.box.com/s/30umimdqsbou2gxe4a3p. Pretty hideous, eh?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

MADubs wrote:Fred, didn't you say you are running a Mac? If so, I don't think you will ever see the green, so all the code will work fine for you, ya know? The problem only shows up in Office 2010 and older on a PC
Yes, I am on a Mac. Sorry, I guess I cannot help further. You can still try my previous suggestions about your tiff differences and see if that helps. My only other thought is that those old Word version do not support grayscale and are trying to convert that to RGB, but are leaving out the red and blue channels. Try adding one red pixel into the top left corner of your image as a test, so that the tiff file is now RGB. Alternately, try adding an sRGB profile to your grayscale Tiff. IM may not like that and object, but it might be worth a try. That may just be the issue, since your PS created TIFF was grayscale with sRGB profile and with no alpha channel, so turn alpha off in your IM tiff along with adding the sRGB profile.

Perhaps there is some IM Windows user who has Word, who can help you.
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

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

Post by MADubs »

I'm afraid the problem persists with RGB files like the one I posted today...it is not specific to Grayscale. I really appreciate you trying to help...sorry we couldn't solve the mystery. I will keep working on finding the differences between the two using your suggestions. Thanks again!
Post Reply