This task is too specific for the software. If you know how the color images(e.g. R,G,B,A channels) are formed, so you can code it in the MATLAB or Python scripts. If you just want to use the software. The imageJ/Fiji can be a good choice and is free and open source.
You can find it in here:
https://imagej.net/Fiji
*There is a video on the YOUTUBE for teaching you to measure color difference ratio using ImageJ*, check this out here:
"How to measure the color difference ratio in TAPS placentas using ImageJ":
You can use MATLAB. When you read an image in matlab, you will get a matrix of numbers range between 0-1 or 0-255(shades of gray scale in case of 8-bit). So, X and Y both are numbers representation of colors. If you want to quantify the ratio of X color to Y color, then you can use X and Y intensity value as threshold to extract the corresponding areas to these colors and then count the no. of pixels in each region.