updated win32 dist method
auto downsample large image