Details

Test the downsampling options in the FreeImage library and test for different downsampling settings to check what options gives better size vs quality. The idea is to create an automatic downsampling selector based on the desired quality level defined in the OSCPMWin configuration.

Does FreeImage do any chroma subsampling when saving a JPEG image? If yes, is there any way to tune it or is it done automatically depending on the quality setting? If not, is this a limitation of the libjpeg library?

FreeImage uses the LibJPEG "high level API" to store images. What LibJPEG does behind the scene is unknown.
You should download the LibJPEG v6b from http://www.ijg.org/ and read the *.doc files. These files explain the capabilities of the library and all the configurable options that could be added into a higher level API such as FreeImage.

I found the libjpeg library defaults to a 2x2 (4:2:0) chroma downsampling/subsampling which produces the smallest JPEG files. I tested changing the chroma subsampling to 2x1 (4:2:2) and no subsampling at all (1x1 / 4:4:4) and found the image quality the same than 2x2, but these modes caused the image size to grow around 30 to 40% (at least in my test images).