It's possible to some extent but won't be really accurate, the idea is load image with a known file size then in its onload
event measure how much time passed until that event was triggered, and divide this time in the image file size.
Example can be found here: https://stackoverflow.com/questions/4583395/calculate-speed-using-javascript
Test case applying the fix suggested there: