public function getColorPalette($image, $colorCount, $quality, $colorValue)
    {
        try {
            $source = new LocalSourceImageModel($image);
            $source->getLocalCopy();
        } catch (ImagerException $e) {
            return null;
        }

        $palette = ColorThief::getPalette($source->getFilePath(), $colorCount, $quality);

        ImagerService::cleanSession();

        return $colorValue === 'hex' ? $this->paletteToHex($palette) : $palette;
    }