I appear to be getting a thin red outline around high contrast areas in some of my pictures such as tree branches against a light sky.

This is more than likely due to a phenomenon called ‘bleeding’ on your image sensor. This is where light from one pixel bleeds over to an adjacent pixel which is designed to detect a different colour. This is a disadvantage to Bayer type sensors and the result is a thin red outline around dark areas on a bright background.