Image is green when opened in MODI

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
gustav
Posts: 6
Joined: 2017-12-08T07:59:05-07:00
Authentication code: 1152

Image is green when opened in MODI

Post by gustav »

I'm trying to compress images from 24bit to 8bit. They look fine until I open them in Microsoft Office Document Imaging, where they are green.

This is the command I run:

Code: Select all

convert C:\Users\******\Orginal.TIF -type palette -auto-level -channel RGB -depth 8 C:\Users\******\Compressed.TIF
Here's an example: https://imgur.com/a/D8PD8

So why is it green specifically when opened in MODI? In other programs the compressed image looks fine.

Any help is appreciated! Thanks in advance!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image is green when opened in MODI

Post by fmw42 »

Please always provide your IM version and platform, since syntax may differ and bugs exist.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image is green when opened in MODI

Post by fmw42 »

-channel RGB does nothing in your command. Perhaps you meant -colorspace sRGB (RGB in very old versions of IM), although your image is already RGB as opposed to CMYK.

Try one of these and see if they work.

Code: Select all

convert image.jpg -colorspace sRGB -type palette -depth 8 -compress none image.tif

Code: Select all

convert image.jpg -colorspace sRGB -type palette -depth 8 -compress lzw image.tif
If your IM version is very old use -colorspace RGB rather than sRGB

You can add -auto-level if you want.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image is green when opened in MODI

Post by snibgo »

gustav wrote:So why is it green specifically when opened in MODI? In other programs the compressed image looks fine.
That sounds like a question for Microsoft. But they discontinued MODI in 2010, so they might not answer.
snibgo's IM pages: im.snibgo.com
gustav
Posts: 6
Joined: 2017-12-08T07:59:05-07:00
Authentication code: 1152

Re: Image is green when opened in MODI

Post by gustav »

snibgo wrote: 2017-12-08T14:49:56-07:00 That sounds like a question for Microsoft. But they discontinued MODI in 2010, so they might not answer.
Other 8bit images work in this program. The problem only appears with images converted with ImageMagick.
gustav
Posts: 6
Joined: 2017-12-08T07:59:05-07:00
Authentication code: 1152

Re: Image is green when opened in MODI

Post by gustav »

fmw42 wrote: 2017-12-08T11:13:45-07:00 Please always provide your IM version and platform, since syntax may differ and bugs exist.
Right. I'm using ImageMagick 7.0.7-11 on Windows 10.
gustav
Posts: 6
Joined: 2017-12-08T07:59:05-07:00
Authentication code: 1152

Re: Image is green when opened in MODI

Post by gustav »

fmw42 wrote: 2017-12-08T11:19:25-07:00 -channel RGB does nothing in your command. Perhaps you meant -colorspace sRGB (RGB in very old versions of IM), although your image is already RGB as opposed to CMYK.

Try one of these and see if they work.

Code: Select all

convert image.jpg -colorspace sRGB -type palette -depth 8 -compress none image.tif

Code: Select all

convert image.jpg -colorspace sRGB -type palette -depth 8 -compress lzw image.tif
If your IM version is very old use -colorspace RGB rather than sRGB

You can add -auto-level if you want.
Thanks! Sadly, the problem persists.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image is green when opened in MODI

Post by fmw42 »

See http://www.imagemagick.org/script/comma ... php#define for the list of tiff defines. Perhaps the issue is the endian or fill order or rows per strip. Since none of us use MODI, we have no way to test these.

You could send us a tiff file that seems to work and another from imagemagick that does not seem to work and we can examine the difference. You can post to some free hosting service and put the URLs here.
gustav
Posts: 6
Joined: 2017-12-08T07:59:05-07:00
Authentication code: 1152

Re: Image is green when opened in MODI

Post by gustav »

fmw42 wrote: 2017-12-11T11:03:39-07:00 You could send us a tiff file that seems to work and another from imagemagick that does not seem to work and we can examine the difference.
I've had some problems obtaining two images that can be compared, but I now have two 8bit images, one converted with ImageMagick and one converted with another program. The first image in the following imgur gallery shows up normal in MODI, while the second one is green in MODI. It also shows up pink in Outlook thumbnails.

https://imgur.com/a/Ixqp2

If anyone is still interested in helping with this I would be very thankful.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image is green when opened in MODI

Post by fmw42 »

Are these input or output images? Your original command shows tiffs, but you provided jpg images. Then you said above these were converted with different tools, so it would appear they are output? Did you images get converted to jpg by IMGUR or did you provide them? They are not 8-bit total color, but 24-bit color. So perhaps they got changed by IMGUR. Try dropbox.com or some other host that does not change images.

Please provide the original input and the two outputs.

Or clarify further.

The two files you uploaded are identical. Even the meta data are identical

Code: Select all

compare -metric rmse good.jpg bad.jpg null:
0 (0)
gustav
Posts: 6
Joined: 2017-12-08T07:59:05-07:00
Authentication code: 1152

Re: Image is green when opened in MODI

Post by gustav »

fmw42 wrote: 2018-01-04T10:17:23-07:00 So perhaps they got changed by IMGUR.
This is definitely the case. I didn't know IMGUR did that, my bad.

https://www.dropbox.com/s/wocn5271k8abl ... ftware.TIF

https://www.dropbox.com/s/08zvxkkjs5aui ... Magick.TIF
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image is green when opened in MODI

Post by fmw42 »

I see only 3 difference is the meta data

1) The good file lists Scene 1. The ImageMagick file does not list that. I doubt this is the issue and I do not know how to make ImageMagick read that.

2) The good file has tiff:rows-per-strip: 71. The ImageMagick file has tiff:rows-per-strip: 3518. This may be the issue. You can make imagemagick set the rows-per-strip to 71 by using -define tiff:rows-per-strip=71.

3) The histograms are the same, but the colormaps are different. That also may be an issue. But I know of no way to directly change the colormap other than creating a colormap image to match the good colormap and then using -remap to modify the colors in the image and the associated colormap. See http://www.imagemagick.org/Usage/quantize/#remap

The images are identical pixel-wise.

Code: Select all

compare -metric rmse with_other_software.TIF with_ImageMagick.TIF null:
0 (0)

But it gives a warning about an unknown tag, which may or may not be important to your issue. Tiff allows special tags associated with other software and measurements. But ImageMagick will ignore those with a warning, which is in this case:

compare: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/912.

See if the rows per strip helps.

You can see all this using identify -verbose on each of your two images.
Post Reply