This uses no for-loops - only index manipulation. Intended use is for iterative programs where increased speed pays off, but works just fine for individually controlled use as well - though in this case the user may want to adjust the function to include various parameters as input variables (for iterative programs these are usually constant, so they are set to typical values within the function).
No error checking is used, as that could slow things down and is generally unnecessary for an iterative program presumably using fixed image sizes and pixel values.
Returns joint histogram, mutual information, and joint entropy. It is expected that no one will need all three, so instructions on how to remove that which is not needed is included.