Page 1 of 1

Conversion of CR2 to tif significantly worse than Photoshop

Posted: 2014-04-15T12:18:59-07:00
by aporthog
Version: ImageMagick 6.8.6-10 2013-09-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib freetype jbig jng jp2 jpeg lcms png ps png tiff webp x xml zlib
OS; Windows 7

When I do a straightforward conversion of a CR2 file to tiff, the quality is very poor:

convert sample.CR2 im_out.tif

When I do the conversion in either Adobe Camera Raw or something like ThumbsPlus, the quality is much better. Why would this be?

Here are some jpeg samples that illustrate the problem

This is the IM version reduced in size and saved as jpeg:

Image

Even with the reduction in size you can see it has a bluish tint compared to the photoshop version here:

Image

Next I've zoomed in on a portion of both images. But it's hard to distinguish the difference in quality. The blue tint is still obvious though:

IM:

Image

Photoshop:

Image

Sorry the original files are so large, but they are linked below. The photoshop versions have a smoother background, the text isn't as fuzzy.

The original CR2 file (27 MB) is here: http://ucblibrary4.berkeley.edu/~apollo ... sample.CR2
The IM uncompressed tiff output (48-bit 121 MB): http://ucblibrary4.berkeley.edu/~apollo ... im_out.tif
The Photoshop version (24-bit 60 MB): http://ucblibrary4.berkeley.edu/~apollo ... ps_out.tif

Could it be photoshop does some corrections by default and IM only does exactly what you tell it?

Re: Conversion of CR2 to tif significantly worse than Photos

Posted: 2014-04-15T12:34:06-07:00
by Bonzo
I think Imagemagick uses dcraw these days and you can edit the default options Imagemagick uses in the delegates.xml file on this line:
<delegate decode="dng:decode" stealth="True" command="dcraw.exe -6 -w -O "%u.ppm" "%i""/>

It may be setup more for images rather than what you want?

This website shows the options and you might want to add -d and remove something else - possably a bit of trial and error. You could also add some sharpening to your command.

Re: Conversion of CR2 to tif significantly worse than Photos

Posted: 2014-04-15T20:00:59-07:00
by snibgo
aporthog wrote:Could it be photoshop does some corrections by default and IM only does exactly what you tell it?
I haven't looked at your images, but that is almost certainly the issue.

For Nikon NEF files, and I assume Canon CR2 is the same, the raw image contains metadata about camera settings for contrast, saturation, sharpening etc. dcraw ignores all this metadata apart from white balance. IM ignores all this metadata.

Re: Conversion of CR2 to tif significantly worse than Photos

Posted: 2014-04-16T03:41:51-07:00
by snibgo
For the colour balance, you can tell dcraw to make a certain area into gray, eg:

Code: Select all

dcraw -v -6 -A 2000 2000 1000 1000 -T -O s.tif sample.cr2
This gives you four RGBG parameters that you might use for all images in the same book, for consistency.

For the sharpening, exiftool tells me the camera settings. SceneCaptureType='Standard' and Canon:SharpnessStandard='3'. Compare this to Canon:SharpnessNeutral='0'. So I expect Photoshop is applying some sharpening.

Re: Conversion of CR2 to tif significantly worse than Photos

Posted: 2014-04-18T08:01:02-07:00
by aporthog
Thanks all for the pointers. I read up some more on dcraw and found some other threads on raw files and IM and it's clear to me now. I have been applying a CLUT to my images as well as other enhancements such as sharpening with good results. Recently a colleague wanted to work with the unenhanced versions of some of my images and we were puzzled why the basic output was so much worse than what Photoshop and other imaging programs performed and now i see the Photoshop versions weren't unenhanced.

Re: Conversion of CR2 to tif significantly worse than Photos

Posted: 2014-04-18T08:48:26-07:00
by snibgo
If you really want unenhanced, try this:

Code: Select all

dcraw -v -6 -W -r 1 1 1 1 -g 1 1 -D -d -T -O out.tiff sample.cr2
This is as raw as it gets. No demosaicing, no correction for the different sensitivities of the RGB sensors, no gamma, no nothing. Just the raw linear sensor data.

See if your colleague is happy with that!