dpi calculation improved