php/doc-en

Imagick::setImageType documentation explains nothing

オープン

#2,990 opened on 2023/12/03

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)XML (882 件のフォーク)auto 404
Extension: Imagickgood first issue

Repository metrics

Stars
 (596 個のスター)
PR merge metrics
 (平均マージ 99d 23h) (30d で 90 merged PRs)

説明

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.

コントリビューターガイド