Intervention/image · error · NotSupportedException
Color profiles are not supported by GD driver
Error message
Color profiles are not supported by GD driver
What it means
The GD driver has no ICC color profile support at all - libgd contains no colorspace management. The specialized ProfileModifier therefore does nothing but throw NotSupportedException the moment it is applied (via $image->setProfile()), regardless of input. This is a hard capability gap rather than a runtime failure: with the GD driver, profile operations can never succeed; the Imagick driver implements them natively.
Source
Thrown at src/Drivers/Gd/Modifiers/ProfileModifier.php:23
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\ProfileModifier as GenericProfileModifier;
class ProfileModifier extends GenericProfileModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*
* @throws NotSupportedException
*/
public function apply(ImageInterface $image): ImageInterface
{
throw new NotSupportedException(
'Color profiles are not supported by GD driver',
);
}
}
View on GitHub (pinned to 5598b9e397)
Solutions
- Switch the manager to the Imagick driver when profile support is required (ext-imagick must be installed)
- Gate the call: skip profile operations when the active driver is GD
- Handle ICC profiles outside the library (exiftool, pel) on the encoded file before/after processing
- Catch NotSupportedException and continue without profile embedding
Example fix
// before
$manager = new ImageManager(GdDriver::class);
$image = $manager->decode('photo.jpg')->setProfile($profile); // NotSupportedException
// after
use Intervention\Image\Drivers\Imagick\Driver as ImagickDriver;
$manager = new ImageManager(ImagickDriver::class);
$image = $manager->decode('photo.jpg')->setProfile($profile); Defensive patterns
Strategy: type-guard
Validate before calling
use Intervention\Image\Drivers\Gd\Driver as GdDriver;
// you control the driver at construction time - decide there
$manager = new ImageManager(ImagickDriver::class);
$driverSupportsProfiles = !$manager->driver instanceof GdDriver;
if ($driverSupportsProfiles) {
$image->setProfile($profile);
} Type guard
use Intervention\Image\Drivers\Gd\Driver as GdDriver;
use Intervention\Image\Interfaces\DriverInterface;
function supportsColorProfiles(DriverInterface $driver): bool
{
return !$driver instanceof GdDriver;
} Try / catch
use Intervention\Image\Exceptions\NotSupportedException;
try {
$image->setProfile($profile);
} catch (NotSupportedException $e) {
// GD cannot manage ICC profiles; continue without embedding
$logger->info('Skipped profile embedding: ' . $e->getMessage());
} Prevention
- Decide the driver based on required features: profiles need Imagick.
- Centralize driver selection in one factory so capability checks are easy.
- Assert required extensions (ext-imagick) at boot, not at image time.
When it happens
Trigger: Calling $image->setProfile($profile) on an image created by a manager built with Intervention\Image\Drivers\Gd\Driver; portable pipelines that run the same code under both drivers; automated color-management steps that assume Imagick features exist everywhere.
Common situations: Production hosts that only offer ext-gd; migrating a working Imagick pipeline to GD for deployment; trying to embed sRGB profiles into uploads on shared hosting.
Related errors
- Class '{objectShortname}' is not supported by {id} driver
- Trim modifier cannot be applied to animated images
- Invalid $limit value. Must be int<1, max>
- Call to undefined method Intervention\Image\Image::{name}()
- No decoders in array
AI-assisted analysis of Intervention/image@5598b9e397 (2026-08-23).
Data as JSON: /api/errors/6bc1706554a2555b.
Report an issue: GitHub.