Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

python cv2 load image from image file, url or base64 code of image

Project description


python cv2通过图片文件、图片url、图片的base64编码加载图片。cv2ImageLoad


pip install cv2imageload


from cv2imageload import ImageLoad, ImageLoadError

file = 'th-108.jpg'
url = 'http://*.com/test.png'
base64_str = '图片的base64编码字符串'

# 加载图片文件
    image = ImageLoad.loadImage(file)
except ImageLoadError as e:

# 将图片编码为base64字符串
    base64_str = ImageLoad.base64EncodeImage(image, with_base64_header=True, file_ext='jpg')
except ImageLoadError as error:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cv2imageload, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size cv2imageload-1.0.2-py3-none-any.whl (4.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size cv2imageload-1.0.2.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page