def topil(self, **kwargs): """ Get PIL Image. :return: :py:class:`PIL.Image`, or `None` if the composed image is not available. """ if self.has_preview(): return pil_io.convert_image_data_to_pil(self._record, **kwargs) return None
def topil(self, channel=None, **kwargs): """ Get PIL Image. :param channel: Which channel to return; e.g., 0 for 'R' channel in RGB image. See :py:class:`~psd_tools.constants.ChannelID`. When `None`, the method returns all the channels supported by PIL modes. :return: :py:class:`PIL.Image`, or `None` if the composed image is not available. """ if self.has_preview(): return pil_io.convert_image_data_to_pil(self, channel, **kwargs) return None