Skip to content

imagick: document the image types - #5826

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:fix/imagick-image-types
Open

imagick: document the image types#5826
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:fix/imagick-image-types

Conversation

@lacatoire

Copy link
Copy Markdown
Member

The IMGTYPE_* constants had empty descriptions, and Imagick::setImageType() only repeated its own name with an empty parameter entry, so nothing on either page said what an image type is or what the MATTE variants mean.

Each constant now states the conversion SetImageType() actually performs, taken from the switch in MagickCore/attribute.c: which colorspace the image is transformed to, whether it is quantised, and whether the alpha channel is kept or discarded. Two of them convert nothing at all — IMGTYPE_UNDEFINED and IMGTYPE_OPTIMIZE fall through to a bare break.

The group introduction answers the question the issue asks: MATTE is the ImageMagick 6 name for the alpha channel, and Imagick registers an ALPHA spelling with the same value when built against ImageMagick 7.

Imagick::setType() is also given a sentence distinguishing it from Imagick::setImageType(): it sets the type used for images read or written afterwards, whereas setImageType() converts the current image. Both previously carried nearly the same description.

Fixes: #2990

@lacatoire
lacatoire force-pushed the fix/imagick-image-types branch 3 times, most recently from 6c5cf89 to 07bacc6 Compare September 2, 2026 15:09
The IMGTYPE_* constants had empty descriptions and Imagick::setImageType
only repeated its own name, leaving readers to guess what an image type
is and what the MATTE variants mean.

Each constant now states the conversion SetImageType() performs, and the
group notes that MATTE is the ImageMagick 6 name for the alpha channel,
with the ALPHA spellings available as of ImageMagick 7. setType() is
distinguished from setImageType().
@lacatoire
lacatoire force-pushed the fix/imagick-image-types branch from 07bacc6 to 5947a15 Compare September 2, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imagick::setImageType documentation explains nothing

1 participant