php/doc-en

Imagick::setImageType documentation explains nothing

開放

#2,990 建立於 2023年12月3日

 (0 則留言) (0 個反應) (0 位負責人)XML (882 個分叉)auto 404
Extension: Imagickgood first issue

倉庫指標

星標
 (596 顆星)
PR 合併指標
 (平均合併 99天 23小時) (30 天內合併 90 個 PR)

描述

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.

貢獻者指南