MCPcopy Create free account
hub / github.com/ZiniuLu/Python-100-Days / main

Function main

Day66-75/code/example12.py:10–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def main():
11 guido_img = Image.open(open('guido.jpg', 'rb'))
12 guido2_img = guido_img.filter(ImageFilter.GaussianBlur)
13 guido2_img.save(open('guido2.jpg', 'wb'))
14
15 img1 = Image.open(open('tesseract.png', 'rb'))
16 img2 = img1.point(lambda x: 0 if x < 128 else 255)
17 img2.save(open('tesseract2.png', 'wb'))
18
19 print(image_to_string(img2))
20
21 resp = requests.get('https://pin2.aliyun.com/get_img?type=150_40&identity=mailsso.mxhichina.com&sessionid=k0xHyBxU3K3dGXb59mP9cdeTXxL9gLHSTKhRZCryHxpOoyk4lAVuJhgw==')
22 img3 = Image.open(BytesIO(resp.content))
23 img3.save('captcha.jpg')
24 print(image_to_string(img3))
25 print(base64.b64encode(resp.content))
26
27
28if __name__ == '__main__':

Callers 1

example12.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected