code: def region(self, rect):
          
          box = (int(rect[0]), int(rect[1]), int(rect[0]) + int(rect[2]),
                 int(rect[1]) + int(rect[3]))
          if box[2] > self.img.size[0] or box[3] > self.img.size[1]:
              raise errors.RectangleError("Region out-of-bounds")
          self.img = self.img.crop(box)
          return self
docs: Selects a sub-region of the image using the supplied rectangle,
              x, y, width, height.