added dpi kwarg