DEV Community

Discussion on: NFT images generator using Python Jupyter Notebook

Collapse
 
jzamora1108 profile image
JZamora1108

Hey Victor, I have everything in there but keep getting an error message in relation to saving the images to a file. Can you please help out. New to the PIL function but is the f in Image.open(f'... the folder location or what does the f designate?

Collapse
 
jzamora1108 profile image
JZamora1108

FileNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_25676/1624990664.py in
1 for item in all_images:
2
----> 3 im1 = Image.open(f'./layers/backgrounds/{background_files[item["Background"]]}.jpg').convert('RGBA')
4 im2 = Image.open(f'./layers/circles/{circle_files[item["Circle"]]}.png').convert('RGBA')
5 im3 = Image.open(f'./layers/squares/{square_files[item["Square"]]}.png').convert('RGBA')

~\AppData\Roaming\Python\Python39\site-packages\PIL\Image.py in open(fp, mode, formats)
2966
2967 if filename:
-> 2968 fp = builtins.open(filename, "rb")
2969 exclusive_fp = True
2970

FileNotFoundError: [Errno 2] No such file or directory: './layers/backgrounds/orange.jpg'