Let's see how the edge detection and enhancement filters modify the data of a picture. The photograph that we will use is a close-up of a leaf. The original photo is shown in the next illustration. Applying an edge detection filter on this image creates a cool effect where only edges are highlighted and the remaining portion of the image is rendered as black.
0165_3_6_Before_EDGE_ENHANCE.pngfrom the Packt website and save it as
1 import Image 2 import ImageFilter 3 import os 4 paths = [ "C:\images\Before_EDGE_ENHANCE.png ", 5 "C:\images\After_EDGE_ENHANCE.png ", 6 "C:\images\EDGE_DETECTION_1.png ", 7 "C:\images\EDGE_DETECTION_2.png ...