Write an extension method for the Image class named SaveImage that saves the image with an appropriate file format. For example, if the method's filename parameter has a .png extension, the method should save the image with the PNG format.
Write a program to test this method.