def apply(self, clip: Clip) -> Clip:
        """Apply the effect to the clip."""
        if self.width and self.x1 is not None:
            self.x2 = self.x1 + self.width
        elif self.width and self.x2 is not None:
            self.x1 = self.x2 - self.width

        if self.height and self.y1 is not None:
            self.y2 = self.y1 + self.height
        elif self.height and self.y2 is not None:
            self.y1 = self.y2 - self.height

        if self.x_center:
            self.x1, self.x2 = (
                self.x_center - self.width / 2,
                self.x_center + self.width / 2,
            )

        if self.y_center:
            self.y1, self.y2 = (
                self.y_center - self.height / 2,
                self.y_center + self.height / 2,
            )

        self.x1 = self.x1 or 0
        self.y1 = self.y1 or 0
        self.x2 = self.x2 or clip.size[0]
        self.y2 = self.y2 or clip.size[1]

        return clip.image_transform(
            lambda frame: frame[
                int(self.y1) : int(self.y2), int(self.x1) : int(self.x2)
            ],
            apply_to=["mask"],
        )
Apply the effect to the clip.
moviepy/video/fx/Crop.py