php/doc-en

Imagick::setImageType documentation explains nothing

Ouverte

#2 990 ouverte le 3 déc. 2023

 (0 commentaire) (0 réaction) (0 personne assignée)XML (882 forks)auto 404
Extension: Imagickgood first issue

Métriques du dépôt

Stars
 (596 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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.

Guide contributeur