示例#1
0
    def compose(self):
        """
        Compose layer and masks (mask, vector mask, and clipping layers).

        :return: PIL Image object, or None if the layer has no pixels.
        """
        from psd_tools.api.composer import compose
        return compose(self)
示例#2
0
    def compose(self, *args, **kwargs):
        """
        Compose layer and masks (mask, vector mask, and clipping layers).

        :return: :py:class:`PIL.Image`, or `None` if the layer has no pixel.
        """
        from psd_tools.api.composer import compose
        if self.bbox == (0, 0, 0, 0):
            return None
        return compose(self, *args, **kwargs)
示例#3
0
    def compose(self, bbox=None, **kwargs):
        """
        Compose the artboard.

        See :py:func:`~psd_tools.compose` for available extra arguments.

        :param bbox: Viewport tuple (left, top, right, bottom).
        :return: :py:class:`PIL.Image`, or `None` if there is no pixel.
        """
        from psd_tools.api.composer import compose
        return compose(self, bbox=bbox or self.bbox, **kwargs)
示例#4
0
    def compose(self, force=False, bbox=None, **kwargs):
        """
        Compose the PSD image.

        See :py:func:`~psd_tools.compose` for available extra arguments.

        :param bbox: Viewport tuple (left, top, right, bottom).
        :return: :py:class:`PIL.Image`, or `None` if there is no pixel.
        """
        from psd_tools.api.composer import compose
        image = self.topil() if (not force or len(self) == 0) else None
        if image is None:
            image = compose(self, bbox=bbox or self.viewbox, **kwargs)
        return image