adding ben alman's resample dpi script