(x1, y1) is the top-left corner and (x2,y2) is the bottom-right corner. I am not sure why they would not fulfill the 0-W and 0-H range. They are the width and height of the image right? Surely the points cannot go outside the image ?