Inverse chromatic aberration

Hi,

I have an image which is watched through a lens.
Due to the quality of the lens I see chromatic aberration especially for black objects on white background.
In Blender there is one node called ‘Lens distortion’. If you set the Dispersion value to e.g. 0.2 you can simulate this chromatic aberation effect.
What I want to do now is to render my image with the negative dispersion value of -0.2.
The result will be an image with inverse chromatic aberation. If I watch this image through my lense again I hope to eliminate the chormatic aberation. I don’t know if this will work, but I want to give it a try.
Unfortunately the Dispersion value in the blender node can only take positive values :(.

Is there any way (may an additional node) to inverse the result of the dispersion somehow?

Thanks!

Swap R and B channels and use positive value. Then swap channels again. If this aberration op is of any good it should work. It breaks if green channel is also distorted though…

You won’t be able to eliminate the optical effects of a real lens, nor will an attempt to compensate for them by tinkering with the original have the intended result, I expect . . . :frowning:

Removing aberration from real footage is hard but can be done to a certain point. Compensating for a lens is easier but also not 100% perfect. It is done for example for Oculus Rift VR gear which has rather strong chromatic aberration due to its lens system. As we operate on three distinct channels (or wavelengths, although it is simplified to say so), we have to match or inverse the distortion of each color separately. In the simplest case we can scale the R and B channels (with scaling center on lens optical center). If distortion is nonlinear, use lensdistortion or similar on R and B channels.

Keep in mind that if you scale or distort R channel with factor bigger than 1 you have to scale the B channel with factor smaller than 1. It should be 1\R-factor or something near that. In lensdistortion it should be +factor and -factor as factor=0 means no distortion.

Lens profile-based filters to remove c. abberation are a real thing. (same basic idea as the profiles for barrel/pincushion distortion) And they do work if the effect isn’t that severe. There’s going to be some softening of the image of course. It might be pretty tricky to do in Blender though. Getting the values right without measurements is tricky.