# LR/Mogrify ICC Profile problems only with BW Tiffs(!)



## Munene (Apr 10, 2011)

Hi, I will try and give enough information here to get help, probably will miss something.

First:  I have windows XP SP3, AMD dual core, 4gb ram, +1tb hard dive...
Lightroom 3, Adobe CS4.

OK:

I just installed image magick and LR/Mogrify.  pretty simple, in the end.  My main desire is to export images from lightroom after I have adjusted them (generally either raw files or Tiffs) with borders, to put up on my website.  Up until now I had to open them in Photoshop, enlarge the canvas, etc.  It is a pleasure to now nearly never have to even open P-shop.

OK, so I set up all the parameters for the export with 5px black borders, JPEGS at 600px X 600px, and no bigger than 125kb (again, for my website).

The RAW files have all exported and converted with no problems.  It is the Tiffs that are problematic.

The TIFFs are 135mb files that were my negatives scanned on a Nikon Coolscan 9000 at 4000dpi (yes, big, I know).

Now, after adjusting them, the color images export through Morgify with no issues. For some reason the B&Ws have issues.

1) I can not see them in Adobe Bridge. They are acknowledged, but with that little icon, no thumbnail.

2) When I open it on P-shop it says: "Embedded ICC Profile cannot be used... is invalid.  Ignoring the profile."  And I check "continue" and it opens, but so, what, I don't need to open it, and I can "save as" and that copy will work, but it is a JPEG, we don't like to do that!

3)  It will open in Dreamweaver and I can import it into  templates with no issues, that is at least something.

4) In Lightroom, when I synchronize the folder these newly created JPEGS are in, they are imported but I get that Little triangle with the "!" and it says I cannot make any development changes to the image, it has encountered problems reading the photo.  Also, of the six or seven I have tried, two have no thumbnail in the library (the others do).

So, help someone!!!  Please!!!   I am fairly literate in this, until I get to the real computer technical stuff.  So, plane language or definitions of some tech talk would be nice.

Thank you SOOO much in advance.

Cheers,

Munene


----------



## Victoria Bampton (Apr 12, 2011)

Hi Munene, welcome to the forum!

It's a while since I've heard of that one, but I seem to remember this was a corrupted profile embedded in the scans.  If you open in PS and ignore the profile, you should be able to do a Save As TIFF rather than JPEG, so you don't need to worry about the degradation involved.  The question is, do those resulting TIFFs then work properly?  If they do, then there should be ways of batching the files so you don't have to do each one individually.


----------



## Munene (Apr 13, 2011)

*I have isolated the problem*

Thanks for the welcoming Victoria.

As to your suggestion:  It does work, but since they are meant to be 
used in templates made in Dreamweaver to post on my website 
(www.visualquotations.com), I really do not need them to be TIFFs at 
all, once I have already converted them to JPEG from the original TIFF file 
with the adjustments. [to skip my narrative and cut to the chase, go to the *** paragraph.]

For what it is worth, I can open and view them in Windows Picture 
Viewer, so it is definitely isolated to Adobe.


I have been scanning these on the same scanner off and on for over 
two years, and I have tried both BW files and color ones from all 
different time periods, and the colored conversions are fine, the BW 
ones are not (again this only happens when I go thru Mogrify).  Except a few worked!


OK, I left it alone for a few days to try and approach it more 
"scientifically".  I tried many variations of images that were 
scanned a while ago and the most recent.  Those adjusted on LR2 and 
those on LR3.  And those not adjusted.  I also tried the color, all the color were OK.  Some of the BW were OK too!


***The long and the short of it is, unadjusted (un-developed in LR speak) BW are fine.  Adjusted (developed) BW are fine until I throw out the color profile in the development module in lightroom!!!  Here is the issue!   I even made a virtual copy of an older fully adjusted BW image that did not convert thru Mogrify well, reset it to its un-developed state and exported it, and it was fine.

If anyone is reading this, can they try it and see what happens?

I also converted a BW adjusted image to a smaller TIFF file instead 
of a JPEG, thru Mogrify, and it was fine.  So it is something with 
the JPEG conversion and the BW profile created in LR that is somehow 
problematic.


I save the final JPEGs with the borders in my website folders.  It 
will be a pain if I cannot see them in Bridge (I won't really need 
to make any more adjustments to them, so not having that option in 
LR is OK, and the thumbnails seem to all appear in LR, they just have that "!" warning).  And I can select them in Dreamweaver and make the pages.  So, in the end it is minor.  But why???!!  It may be a symptom of something larger.  It is not knowing that is troubling.  So, any thoughts suggestions would be welcomed. Thanks again.

Cheers,

Munene


----------



## Mark Sirota (Apr 13, 2011)

I wonder whether Mogrify is noticing that the image is a color file with only B&W data, and is converting by default to a single-channel (not RGB image) or something.  Can you export one of the TIFF files that Mogrify dislikes, without using LR/Mogrify, and post it somewhere that we can see?  There's probably a command-line argument to Mogrify that will fix this.


----------



## Munene (Apr 13, 2011)

Mark,

I am not sure what to export (or where, for that matter).  After I put up those last comments, it occurred to me that if the issue was where I thought it was, then the same would happen if I converted a RAW file to B&W in LR and exported it through Mogrify into a JPEG as well.  Sure enough, it was problematic.  So, it is not the TIFF file/scan per se, but any color image that gets developed/converted into B&W in Lightroom, and then exported through Mogrify and converted to a JPEG.  Converting it to a TIFF thru Mogrify is OK.  Maybe you can try this and see what happens?  The final JPEGs are only about 125kb, I would be happy to e-mail one to you if that is allowed on this forum (to give an e-mail address that is).  Or, I can put one of them up on my website, and give the link, but I am not sure that will give you the information needed to make an assessment.

Thanks for your help.

Richard (oops, AKA Munene)


----------



## Mark Sirota (Apr 13, 2011)

I'll play later today.  Can you tell me what version of mogrify you've got and precisely what options you're using?


----------



## Munene (Apr 13, 2011)

I am using the latest LR3 version available.  Image Magick is: 6.6.9-3-Q16-windows-dll.  Mogrify is:  LR/Mogrify 2 (version 4.36, I guess. I didn't really pay attention and I cannot find any text file that states the version).  Both of which (Image Magick and Mogrify) were downloaded on April 4, 2011, and installed about a week later.

Options:

Once I am in the export window the Mogrify Configurations are:

The box for strip all metadata from exported images is UN-checked.

Border Options  Identical Borders is checked, 5 pixels, black.

Resizing Options:  Resize to fit is checked.  Fit Inside, every photo.  W-600, H-600 pixels   Algorithm: automatic

Keep aspect ratio is checked.  Fit any outer borders into this target size is checked.

Then it warns that the Mogrify resize settings will override those of LR.

Mogrify JPEG Compress to given file size:  "Compress to Fit" is checked.  125kb.

Post-Processing:  Do Nothing.

On the LR part, The format is JPEG. Color Space is sRGB (maybe that's an issue?).  Quality 60. 

Image size (which should be overridden by Mogrify) is resize to fit is checked, long edge to 600 pixels.  Don't enlarge is UN-checked, 240ppi resolution. 

Here I also have the metadata boxes both UN-checked.

I think that is all.


Thanks for your help and attention!

Richard


----------



## Mark Sirota (Apr 13, 2011)

Okay, I can confirm that LR/Mogrify is overriding the settings in LR's Image Sizing panel.  I can see this because my watermark is tiny in the file, which is what would happen if I export at full size and then downsize outside of Lightroom.

I exported the file twice, once with LR/Mogrify and once without, and compared the metadata using "exiftool -G -s".  There are a number of differences, but the one that jumps out at me is this:

The mogrified version has the EXIF ColorSpace tag set to "Uncalibrated".  The unmogrified version does not set this tag.

LR always embeds the chosen color space (sRGB in this case).  Mogrify has left it alone as it should, but it adds this tag which conflicts with it.  It's possible that Bridge and the other tools you've identified are either blindly trusting the tag rather than the embedded profile, or they're confused by the conflict.

I tried adding "-colorspace sRGB" to the "Parameters for start/end of command line" in the Mogrify Configuration panel to see whether this fixes it, but it has no apparent effect, and I have to run for the train.  I'll look at it again on the train and post my findings later tonight.


----------



## Victoria Bampton (Apr 13, 2011)

I'll leave this one in your capable hands then Mark!  

Just as a passing thought, this old thread may be related: http://www.lightroomqueen.com/commu...523-8-bit-monochrome-jpeg-Lr-doesn-t-see-them


----------



## Munene (Apr 13, 2011)

Thanks, I probably will look for it tomorrow.  How do I find/use the "exiftool -G -S"?  This is where I get lost.


----------



## Mark Sirota (Apr 14, 2011)

Okay, I have a bunch more information.

Unfortunately, the version of mogrify that's bundled with the Mac version of LR/Mogrify 2 is 6.3.6, which is ancient.  The Windows version isn't bundled, so you have a much newer version, and so you might see different behavior.

The problem is that mogrify is, as I suspected, trying to be helpful -- it tries to use the most efficient encoding possible for the smallest possible file size.  It sees that the entire image is shades of gray, so it encodes it as grayscale.  This is described in the documentation for the -type option.

You may be able to fix this by adding "-type TrueColor" to the command line options in the "Parameters for start/end of command line" field in the Mogrify Configuration panel in the Export dialog, but it doesn't work for me for some reason, possibly because my mogrify is ancient.  I tried replacing it with the version from my local ImageMagick installation, but it doesn't work; I'm sure Tim has compiled it differently than I did.  So give that a try and let me know.

If it does, then this is arguably a bug in LR/Mogrify 2 -- Tim should be told.  It should add "-type TrueColor" automatically.  If this doesn't fix it, then that was apparently the wrong tree.

Additionally, you may be able to fix it by changing your workflow a little.  Instead of exporting a full-size file to Mogrify and letting Mogrify resize it, export a 590-pixel file to mogrify and have it only add the borders.  This seems to work for me.

In other words:
- In LR's _File Settings_ panel, choose JPEG, sRGB, Quality 100.  Leave _Limit File Size_ unchecked.
- In LR's _Image Sizing_ panel, check Resize to Fit, Long Edge, 590 pixels.
- Remove LR/Mogrify's _Resize Dimensions_ and _Compress to file size_ actions/panels.
- The only LR/Mogrify action/panels you need are _Mogrify Configuration_ and _Outer Borders_.

Let me know if that works too.

When I get a chance, perhaps later tonight, I'll try running a modern mogrify by hand on some exported grayscale JPEGs to prove this.

_Addendum: _The EXIF ColorSpace tag is not the only thing that changes -- the big key is one that exiftool calls ColorComponents.  In "broken" files, it is 1.  In unbroken files, it is 3.  My Mac renders the file differently (less contrasty) in unbroken files.  I need to look into the exiftool documentation to find out what ColorComponents really means; it is not a standardized EXIF field.

I also find that if I check Minimize Embedded Metadata in LR's export dialog, mogrify adds the EXIF ColorSpace tag (set to Uncalibrated).  If I don't check it, then mogrify doesn't add it.  This seems odd, but again, the mogrify I'm using for this test is ancient.

Tim also needs to be prodded to update the embedded version of mogrify in the Mac version of LR/Mogrify 2.  I'll do that.


----------



## Munene (Apr 14, 2011)

Hi,

I am spending the day scanning more of my negs.  I only get here once in a while, so I plan having a marathon session (12 hours or so).  30 years of negatives, yeesh!  (I scan about 10 an hour)

I will get to your suggestions tomorrow.  I just didn't want you to think I disappeared without saying anything.

Thanks.

Richard (Munene)


----------



## Munene (Apr 15, 2011)

Hello...

OK, I did some extensive samplings.

First, I tried putting "-type TrueColor" (without the quotes) in both the first and end parameter in the configuration, then just the beginning, then just the end.  No luck.  I even tried just "-TrueColor" in case I got that wrong.  It would not recognize the command, so at least I did it right the first few tries, it just didn't help.

Second, I tried your suggested end-around (very clever thought there), giving many different options on the LR side, using Mogrify for borders only.  At Quality 100, the files were OK in Bridge, LR, and P-shop.  So far so good.  But, they were 200kb or more (depending on the image).

So, I found Quality 90, 588px long dimension, 6px border to give me files around 100-120kb and 599-602px long.  Perfect for my templates and web pages.  And, it works for color: scans and born digital, and B&W scans and born digital.  So I saved that setting.

So, for the moment, all is OK, I can export the adjusted images at the sizes and dimensions I want, with borders, instead of having to open photoshop and add the borders manually, saving a very large TIFF file, only to then export that one as a JPEG and decide what to do with the TIFF (I have been keeping them, although I am not sure why).  (I have a folder for adjusted images, and in that folder is one for the website TIFF image).

Do you think there is maybe a bug in Mogrify?  It seems very similar to the issue Victoria led to in that link to the old posting.

Either way, Thanks SOooooooo much for your help.  Check out my site, let me know what you think:  www.visualquotations.com 

Cheers,

Munene/Richard


----------



## Mark Sirota (Apr 16, 2011)

I'm reasonably confident that this is a bug (or rather, an unforeseen edge case) in LR/Mogrify.  The problem is that ImageMagick is very sensitive to the order of arguments on the command line -- it's not good enough to add "-type TrueColor" at the beginning or the end; it needs to be in the right place in the middle.  If I run it by hand and put it right before the output filename, it works properly.

I will report this to Tim.  Unfortunately, until he updates LR/Mogrify to address this, I don't have a good workaround for you.

In other news, this effort has gotten me started on building an up-to-date version of ImageMagick for LR/Mogrify that is compatible with the Lightroom plugin framework, because the one that Tim ships for the Mac is ancient.  That's because building it for this environment is a nightmare, as I'm discovering first-hand.  Assuming I don't give up, Mac users can look forward to an updated version of LR/Mogrify sometime in the not-too-distant future, thanks in part to your question.


----------



## Kiwigeoff (Apr 16, 2011)

Mark Sirota said:


> In other news, this effort has gotten me started on building an up-to-date version of ImageMagick for LR/Mogrify that is compatible with the Lightroom plugin framework, because the one that Tim ships for the Mac is ancient.  That's because building it for this environment is a nightmare, as I'm discovering first-hand.  Assuming I don't give up, Mac users can look forward to an updated version of LR/Mogrify sometime in the not-too-distant future, thanks in part to your question.



Brilliant Mark, I'm sure this will be much appreciated,


----------



## Munene (Apr 16, 2011)

Mark,

Thanks again for all the attention you paid to this.  I'm glad that I at least lit a spark under your seat to get going on a matter that has apparently been under your skin for a bit.  And you did suggest a good work around that all but takes care of it (letting LR/Mogrify do nothing but borders).

Munene


----------



## Munene (Apr 17, 2011)

*addendum*

Hi,

In case anyone is following this with any interest...

I have another work-around which allows me not to worry whether I am exporting color or B&W (with a different saved settings for each scenario).  It also works with either my scanned negatives or born digital:  

Instead of changing the color profile by converting the image to black and white with LR (my scans are done on "color neg" setting on the scanner) (and again, this goes if I want to change a color born digital image to B&W, since I have found myself "seeing" images in B&W, but leaving the camera setting to color), just move all the saturation points -100, and begin adjustments from there.  This way you have perfectly fine & true B&W with full adjustments, but the color profile has never changed, so there is no issue with exporting it to a JPEG with all sizing/borders being done in LR/Mogrify.

I just tested adjusting a B&W scan (which has a warm cast to it before I throw out the color) by both methods, and came up with pretty near identical images.  I had been a custom printer back when those existed, and I would take either one!

So, another workaround with added benefits.

Munene


----------



## Munene (Apr 17, 2011)

Well, disregard the above discovery.  I am getting the same issues.  I thought I had it because on two images I made a monotone, a sepia finish, and they were fine.  I jumped to the conclusion that I could lower the saturation on everything and it would still be "color".  Apparently I was wrong, in four attempts just now, none of them converted to JPEG properly.  So, back to the first work around.  But this is really strange.

M


----------



## Mark Sirota (Apr 18, 2011)

Another workaround that I suspect would work -- make the image almost-but-not-quite monochrome.  You could do this by tinting the entire thing using Split Toning, with saturation set very low, or by painting an almost unsaturated color in some unimportant part of the image.  One slightly non-gray pixel should be enough.  Note that one pixel at full resolution might turn into zero pixels after resizing, so the split toning might be the better way to go.


----------



## Munene (Apr 18, 2011)

Thanks, it was using the split toning to make the sepia look that gave me the idea in the first place, I just didn't check the results of trying it with no toning at all until after I was excited and posted.  I will try and see what minimal color I need to add and maybe it will be something in the not noticeably range.  Thanks.  Still, for now your original workaround is working OK.


----------

