Intervention/image · error · NotSupportedException

Colorspace is not supported by driver

Error message

Colorspace is not supported by driver

What it means

Error "Colorspace is not supported by driver" thrown in Intervention/image.

Source

Thrown at src/Modifiers/ColorspaceModifier.php:54

            $colorspace = new $this->target();

            if (!$colorspace instanceof ColorspaceInterface) {
                throw new NotSupportedException(
                    'Target colorspace "' . $this->target . '" is not supported by driver',
                );
            }

            return $colorspace;
        }

        return match (strtolower($this->target)) {
            'rgb', 'srgb', 'rgba', 'srgba' => new Rgb(),
            'cmyk' => new Cmyk(),
            'hsl' => new Hsl(),
            'hsv', 'hsb' => new Hsv(),
            'oklab' => new Oklab(),
            'oklch' => new Oklch(),
            default => throw new NotSupportedException(
                'Colorspace is not supported by driver',
            ),
        };
    }
}

View on GitHub (pinned to 5598b9e397)

Solutions

  1. Only request colorspaces the current driver supports; GD supports RGB, Imagick supports RGB and CMYK
  2. Check $image->driver()->supports($colorspace) before applying
  3. Switch to the Imagick driver when CMYK or other non-RGB colorspaces are required

When it happens

Trigger: Thrown at src/Modifiers/ColorspaceModifier.php:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Intervention/image@5598b9e397 (2026-08-23). Data as JSON: /api/errors/50d4ee1ae5bed71e. Report an issue: GitHub.