You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 KiB

Image Processing

In [2]:
from PIL import Image
import aalib
In [25]:
im1 = Image.open("Imageresearch/A3.2.png")
In [26]:
im1.size
Out[26]:
(3508, 4961)
In [ ]:
 
In [27]:
im4 = im1
im5 = im4.convert("L")
im6 = im5.convert("1")
im6.save ('A3.2C.png')
In [42]:
im1.convert("L")
im3 = im1.resize((new_width, new_height), Image.ANTIALIAS)
im3.save('resized.png')
im3
Out[42]:
In [17]:
im3.convert("1")
im4 = im3.convert("1")
im4.save('def1.png')
In [73]:
test = Image.open("Imageresearch/Everett.cat.png")
test1 = Image.open("Imageresearch/def1.png")
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-73-66253b0a1980> in <module>
----> 1 test = Image.open("Imageresearch/Everett.cat.png")
      2 test1 = Image.open("Imageresearch/def1.png")

/usr/local/lib/python3.7/dist-packages/PIL/Image.py in open(fp, mode, formats)
   2889 
   2890     if filename:
-> 2891         fp = builtins.open(filename, "rb")
   2892         exclusive_fp = True
   2893 

FileNotFoundError: [Errno 2] No such file or directory: 'Imageresearch/Everett.cat.png'
In [62]:
print (test.size, test1.size)
(588, 400) (400, 500)
In [ ]: