Skip to content

Conversation

@gofr
Copy link
Contributor

@gofr gofr commented Feb 6, 2021

The method uses different defaults for different image modes.

Relates to issue #5217. Maybe enough to fix it, since I think it's just expected behavior that's not documented well enough.

And um, confusing use of the word "method" in the commit message. I mean the method parameter to the Image.quantize function.

The method uses different defaults for different image modes.
src/PIL/Image.py Outdated
:param method: :data:`MEDIANCUT` (default),
:data:`MAXCOVERAGE`,
:data:`FASTOCTREE` (default for RGBA images),
:data:`LIBIMAGEQUANT`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the mention of PIL.features.check_feature(feature="libimagequant")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in the online documentation these methods link to https://pillow.readthedocs.io/en/stable/reference/Image.html#quantization-methods which already mentions exactly what it said here. I thought it would be better not to duplicate information.

I've added another commit to remove even more here and make this link to the existing section instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nulano can you have another look? Are you ok with my changes here?

All quantization methods are already documented in a dedicated
section. Don't duplicate that information in the documentation
of Image.quantize(). Link to the existing section.
@radarhere radarhere changed the title Document Image.quantize "method" defaults [ci skip] Document Image.quantize "method" defaults Mar 2, 2021
@radarhere
Copy link
Member

I've created #5352 as an alternative. It has the same information as yours, just arranged differently.

@gofr gofr closed this Mar 26, 2021
@gofr gofr deleted the document-quantize-default branch March 26, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants