public function contrast($alpha = null, $beta = null) {
        $params = array();

        if ($alpha !== null) {
            $params[] = 'alpha=' . (float) $alpha;
        }

        if ($beta !== null) {
            $params[] = 'beta=' . (float) min(1, max(0, $beta));
        }

        return $this->addTransformation(
            'contrast' . ($params ? ':' . implode(',', $params) : '')
        );
    }