Started on a function that calculates the pixel density.