straditize.common module

Module of commonly use python objects

Disclaimer

Copyright (C) 2018-2019 Philipp S. Sommer

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Functions

rgba2rgb(image[, color])

Alpha composite an RGBA Image with a specified color.

straditize.common.rgba2rgb(image, color=(255, 255, 255))[source]

Alpha composite an RGBA Image with a specified color.

Source: http://stackoverflow.com/a/9459208/284318

Parameters
  • image (PIL.Image) – The PIL RGBA Image object

  • color (tuple) – The rgb color for the background

Returns

The rgb image

Return type

PIL.Image