Resize image by scale ratio and save as other formats.