module imghelper.img_helper
¶
Short summary¶
module pyquickhelper.imghelper.img_helper
Helpers around images.
Functions¶
function |
truncated documentation |
---|---|
Concatenates images into an image with several rows of images. |
|
Sets white color as transparency color. |
|
Zooms an image. |
Documentation¶
Helpers around images.
- pyquickhelper.imghelper.img_helper._optimization_criterion(target, data, weight_above=10, weight_below=1)[source]¶
- pyquickhelper.imghelper.img_helper._optimization_histogram_order(target, data, weight_above=10, weight_below=1)[source]¶
- pyquickhelper.imghelper.img_helper.concat_images(imgs, height=200, width=800, weight_above=10, weight_below=1, background=(0, 0, 0), out_file=None)[source]¶
Concatenates images into an image with several rows of images.
- Parameters:
imgs – filename or Images (Pillow)
height – height of each row (pixels)
width – width of each row (pixels)
weight_above – loss when a line is too long
weight_below – loss when a line is too short
background – background color
out_file – stores the image into this file if not None
- Returns:
Image (Pillow)
- pyquickhelper.imghelper.img_helper.white_to_transparency(img, out_file=None)[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?.
- pyquickhelper.imghelper.img_helper.zoom_img(img, factor=1.0, max_dim=None, out_file=None, fLOG=None)[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