public function histogram($scale = null, $ratio = null, $red = null, $green = null, $blue = null) {
        $params = array();

        if ($scale) {
            $params[] = 'scale=' . (int) $scale;
        }

        if ($ratio) {
            $params[] = 'ratio=' . (float) $ratio;
        }

        if ($red) {
            $params[] = 'red=' . $red;
        }

        if ($green) {
            $params[] = 'green=' . $green;
        }

        if ($blue) {
            $params[] = 'blue=' . $blue;
        }

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