Imagick::setImageType documentation explains nothing
#2.990 aberto em 3 de dez. de 2023
Métricas do repositório
- Stars
- (596 estrelas)
- Métricas de merge de PR
- (Mesclagem média 99d 23h) (90 fundiu PRs em 30d)
Description
From manual page: https://php.net/imagick.setimagetype
The utter lack of documentation about Imagick is appalling. This page is yet another example.
Imagick::setImageType Sets the image type.
What is the image type?? No explanation whatsoever.
Thanks to A USER'S COMMENT one gets that it's true-color vs grayscale vs palette, etc.
Now, by looking at the predefined constants: https://www.php.net/manual/en/imagick.constants.php
one sees there are types such as:
...
imagick::IMGTYPE_GRAYSCALE (int)
imagick::IMGTYPE_GRAYSCALEMATTE (int)
imagick::IMGTYPE_PALETTE (int)
imagick::IMGTYPE_PALETTEMATTE (int)
...
Again, no explanation whatsoever, just a list.
Some are intuitive, but what is the difference between for example IMGTYPE_PALETTE and IMGTYPE_PALETTEMATTE?
Again, the abovementioned user's comment says:
The MATTE variants are equivalent to GrayscaleAlpha, etc. in the ImageMagick command line.
Does that mean that the ones with _MATTE are the ones with alpha? It would seem more intuitive for it to be the other way round.
Either way, more explanations are needed.