Wednesday, December 19, 2007

mogrify LR plugin

See updates below: Mogrify in the default macports installation does not convert to the profile, but will only simply assign a new profile, which indeed is useless. To fix this make sure you install Imagemagick using the command
sudo port install imagemagick +lcms

Not long after I detailed a workflow to print at labs that gives far better results than sending sRGB images, Timothy Armes brings out a plugin for Lightroom that allows you to call mogrify, a part of the open source set of utilities ImageMagick. Check it out here. Highly recommended! This tool allows you to scale (choosing the precise scaling algorithm!) sharpen and convert to an arbitrary profile, all in one step, directly from Lightroom! You just need to know the commandline parameters directly although Tim is adding new stuff to the plugin all the time. For example, to mimic my workflow from a few days ago, you set it up to go to a 16-bit tiff in the ppRGB space, convert to a profile, you do not let Lightroom scale, but you set the mogrify plugin to do it. You just need to calculate the dimensions in pixels, which is easy (ppi*length(inches). In this example, I used fit inside and set it to 5400 pixels, which corresponds to 18 inches at 300 ppi.

As extra commandline parameters, I used:
-profile /Users/{yournamehere}/Library/ColorSync/Profiles/Costco-CO-Arvada-Lus.icc -unsharp 1.2x1+1.5+0.05

The first converts to the profile of my local costcos and the second applies an unsharp mask that nicely sharpens the output image. I need to play with the parameters a little to get the best results, but these are pretty good already.

At the end, the whole image gets saved as a jpeg. Very convenient!

Update I: Of course a minute after I post this, the plugin gets updated to support sharpening from the interface. So you only need the profile command.

Update II: To strip the profile from the files (to save upload time to your lab) use the commandline tool mogrify from after the export. The command is "mogrify +profile filename". If you have a folder of files, just cd into it and use * for the filenames.

Update III: It appears that mogrify does not actually convert to the new profile! So this might be far less useful than I thought. Stay tuned....

Update IV. It turns out that the ImageMagick in MacPorts by default is compiled without lcms support! So it will not convert between profiles, but just append another profile - useless. To make this work, you need to compile ImageMagick from source and installl it and then use the mogrify binary from that installation. This is fairly simple to do but takes some explanation. Bottomline: this can be made to work, but not without a small amount of effort.

For some reason, installing imagemagick in MacPorts with the lcms variant does not work! So you'll have to compile from source. Bummer!

UPDATE V: OK it turns out there is some weird issue because I have been running macports for ages. It did not actually uninstall and install ImageMagick when I told it to. To fix this, if you run into this problem, simply use the commandline:
sudo port -f install imagemagick +lcms

This will force it to actually install it, even though it finds remnants of old imagemagicks. After this the profile conversion works for me in the Macports install.

UPDATE VI: To strip the resulting image of its profile so that you have to upload less bytes, specify -strip in the commandline after the -profile statement. You can also just strip the profile by specifying +profile icc instead.

UPDATE VII: If you get strange results try specifying the source profile before the destination as in -profile /path/to/source -profile /path/to/destination. On my machine, the prophotoRGB profile can be found in an adobe installed folder and can be called like: -profile '/Library/Application Support/Adobe/Color/Profiles/Recommended/ProPhoto.icm' The quotes are essential because of the space in the folder name.

1 comment: