public static function fromString(string $data): self
    {
        if (false === $image = imagecreatefromstring($data)) {
            throw new InvalidArgumentException('Could not read image');
        }

        return new static($image);
    }