To search for a category of photos in the website, and then downloads all the resulting images and to manipulate them locally.
The below Python modules are required in anaconda environment:
- Python built-in modules: urllib.request, requests, os, re
- Web Scraping with Python: BeautifulSoup (bs4)
- Python Imaging Library: Pillow (PIL)
There are five functions defined:
- downloadPhoto() - to download the photos to a local directory 'flickr'
- convertPhoto() - to convert the photos to greyscale and store in a local directory 'flickr/convert'
- resizePhoto() - to resize the photos to 28px by 28px and store in a local directory 'flickr/resize'
- gridPhoto() - to create a image of 5x5 photo grids with 28px by 28px images and store in a local directory 'flickr/grid'
- applyFilter() - to apply a filter (supported ImageFilter) on the original images and store in a local directory 'flickr/filter'