module imghelper.img_helper

Short summary

module pyquickhelper.imghelper.img_helper

Helpers around images.

Functions

function

truncated documentation

white_to_transparency

Sets white color as transparency color.

zoom_img

Zooms an image.

Documentation

Helpers around images.

New in version 1.9.

source on GitHub

pyquickhelper.imghelper.img_helper.white_to_transparency(img, out_file=None)[source][source]

Sets white color as transparency color.

Parameters
  • img – image (Pillow)

  • out_file – stores the image into this file if not None

Returns

image (Pillow)

Code taken from Using PIL to make all white pixels transparent?.

New in version 1.9.

source on GitHub

pyquickhelper.imghelper.img_helper.zoom_img(img, factor=1.0, max_dim=None, out_file=None, fLOG=None)[source][source]

Zooms an image.

Parameters
  • img – image or filename or pattern

  • factor – multiplies the image by this factor if not None

  • max_dim – modifies the image, the highest dimension should below this number

  • out_file – stores the image into this file if not None

  • fLOG – logging function

Returns

image

source on GitHub