Skip to content

Clarify the difference between ImageMagick::setColorspace() and ImageMagick::setImageColorspace() #25

Description

@php4fan

From manual page: https://php.net/imagick.setimagecolorspace


By reading
https://www.php.net/manual/en/imagick.setcolorspace.php and
https://www.php.net/manual/en/imagick.setimagecolorspace.php

I honestly can't tell the differene between the two, when I should use one and when the other.
There's no example for either of them. (BTW there shoudl ALWAYS be examples, every single page of the documentation should have examples)

The descriptions are slightly different:

public Imagick::setColorspace(int $COLORSPACE): bool
Sets the global colorspace value for the object.

vs

public Imagick::setImageColorspace(int $colorspace): bool
Sets the image colorspace. This method should be used when creating new images. To change the colorspace of an existing image, you should use Imagick::transformImageColorspace().

but it's not clear what the difference is between the "global workspace for the object" and "the image colorspace".

This difference should be clarified in both pages. Or if they are actually the same thing, it should be explicitly stated that one is an alias for the other.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions