Source: https://www.lirmm.fr/~strauss/MasterEEA/Bases/TP-Image.pdf