Automating CA correction?
Posted: 2010-08-06T02:39:08-07:00
I would like to use ImageMagick to correct chromatic aberration, the kind that is caused by the lens, going from 0 at the centre of image to its max at the edges. I think it should be doable, but don't know where to start.
I'm surprised that my searches on the internet have revealed no IM methods in this regard. All I know is that dcraw offers what seems to be an easy parameter for CA correction, "-C 0.995 1.005" for instance, which works well. Using dcraw for this would be the easiest solution of all, if one built a list of corrections to be made for specific lenses, and then read the lens info from EXIF when doing the RAW conversion. Alas, the "0.995" part of the dcraw parameter interferes with subsequent processing of the file by ImageMagick, namely the "-contrast-stretch" procedure, it causes IM to output wrong colours. Using "-C 1 1.010" in dcraw instead avoids the IM problem, but doesn't correct CA as well.
I'm hoping there's enough interest in this in the IM community, we can collectively work something out.
I'm surprised that my searches on the internet have revealed no IM methods in this regard. All I know is that dcraw offers what seems to be an easy parameter for CA correction, "-C 0.995 1.005" for instance, which works well. Using dcraw for this would be the easiest solution of all, if one built a list of corrections to be made for specific lenses, and then read the lens info from EXIF when doing the RAW conversion. Alas, the "0.995" part of the dcraw parameter interferes with subsequent processing of the file by ImageMagick, namely the "-contrast-stretch" procedure, it causes IM to output wrong colours. Using "-C 1 1.010" in dcraw instead avoids the IM problem, but doesn't correct CA as well.
I'm hoping there's enough interest in this in the IM community, we can collectively work something out.