Example usage for imghelp

To use imghelp in a project:

Import Required Packages

import matplotlib.pyplot as plt #import matplotlib - for viewing images in Python

To read in jpg images

img = plt.imread('../test_img/ubc.jpeg')

To show images in Python

plt.imshow(img);
_images/example_6_0.png

Example to use ColorConv()

To change image to red - retain red channel only.

from imghelp.colorconv import ColorConv

img_colorconv = ColorConv(img, 'red')
plt.imshow(img_colorconv);
_images/example_8_0.png

Example to use ImgRotate()

To rotate image anti-clockwise 90 degrees.

from imghelp.imgrotate import ImgRotate

img_rotate90 = ImgRotate(img, 90)
plt.imshow(img_rotate90);
_images/example_10_0.png

Example to use ImgCompress()

Apply SVD compression on image with low compression level.

from imghelp.imgcompress import ImgCompress

img_compress = ImgCompress(img, method = 'svd', level=1)
plt.imshow(img_compress);
_images/example_12_0.png