The image was converted to grayscale by iterating over each pixel value in the image matrix and assigning all color channels the maximum value among those channels for the pixel under consideration.
In python inverting the image is a simple operation due to the broadcasting functionality available. The operation is as simple as subtracting the image from the max possible pixel value i.e. 255.
The grayscale image displayed earlier was blurred using the average values of the neighboring 8 pixels for each pixel in the image. The process was repeated 5 times for noticeable results.
To display the oulines in the grayscale image first a copy of the image was created and all pixel values were set to maximum (white). Then after iterating over each pixel value in the grayscale image, each pixel was compared to the next pixel to its right or below it. If the Euclidean distance between those pixels was more than a certain epsilon (which can be adjusted in the function) then the pixel was set to 0 (black).
There was also a parameter in the outline function which can return a image with white outlines on a black image instead of black outlines on a white image by inverting the image.