Modified image resizing, now has potential for further refinement