I have seen that the new Prusa Mk3 design has a optical mouse sensor that can be used to detect if the filament jams. Optical mouse sensors are just a really low resolution camera with no color. I am interested in finding out if it is possible to get access to the image data coming from that sensor? Could I add a rgb led and interpolate the filament color by comparing pixel intensity under different lighting conditions? And I was interested in seeing if the image data could be used to measure the filament width?
No. The sensor is the PAT9125EL. The only output it provides is the movement in the X and Y directions. There is no way to get image data out of it.
Could I add a rgb led and interpolate the filament color by comparing pixel intensity under different lighting conditions
No. The sensor uses laser light of a specific wavelength. It's likely not sensitive to any other wavelengths. On a positive note, there is an "average frame brightness" register that can be read from the chip, but I don't think it's likely to work with RGB LEDs.