We can consider the colorfulness as the average of the differences between R, G and B channels. We must have three comparisons Red vs Green, Green vs Blue and Blue vs Red.
For the start we must make three copies of the image into different layers. We kill 2 colors off from each layer and have one left. The layers are one for red, one for green and one for blue. Killing the 2 other colors from a layer can be done by the curves or the levels tool. It's simpler than messing with the channels panel.
We simulate color separations by desaturating the layers. To be able to use layer modes for comparisons between the layers we also duplicate each layer:
The comparisons are made by setting one layer to have blending mode = difference, the other = normal and when set, the compared layers are merged:
Seems quite dark. But we can add the layers by setting the 2 uppermost to have blending mode = Linear Dodge (that means ADD) and the bottom layer is normal:
This is the colorfullness pixel by pixel. If there were some white areas, those areas would have maximal colorfulness. Black areas are colorless.
By merging the layers and making an average we get the average colorfulnes of the image as single number. This time we do it separately for te top ad lower parts to be able to compare the colorfulnesses:
By checking the brightness by the color picker we get: The upper image has average colorfullness = 37% of maximum and the lower image = 5% of the maximum
The result 37% seems quite low for the upper image which subjectively seems to be very colorful. Let's test the method to really colorful image that has only fully saturated colors:
The pixel by pixel colorfulness are full 100% in every pixel, as expected:
NOTE: This method is so straightforward that it can be recorded as an action.