I convert an image from one format to another and want to use the switch to process different formats.
System.Drawing.Imaging.ImageFormat is public sealed class and switch doesn't work with it.
The below code is working, but I want to use the switch here. Can you help me with some advice?

```
public static void ConvertImageFormat(Image image, string targetImageFilePath, int newWidth, int newHeight, ImageFormat imageFormatToConvert)
    {
        using (Bitmap bitmap = new Bitmap(image, newWidth, newHeight))
        {
            using (Graphics graphic = Graphics.FromImage(bitmap))
            {
                graphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
                graphic.SmoothingMode = SmoothingMode.HighQuality;
                graphic.CompositingQuality = CompositingQuality.HighQuality;
                graphic.PixelOffsetMode = PixelOffsetMode.HighQuality;

                graphic.DrawImage(image, 0, 0, newWidth, newHeight);

                if (Equals(ImageFormat.Png, imageFormatToConvert))
                {
                    bitmap.Save(targetImageFilePath, ImageFormat.Png);
                }
                else if (Equals(ImageFormat.Gif, imageFormatToConvert))
                {
                    bitmap.Save(targetImageFilePath, ImageFormat.Gif);
                }
                else if (Equals(ImageFormat.Jpeg, imageFormatToConvert))
                {
                    ImageCodecInfo[] arrImageCodecInfo = ImageCodecInfo.GetImageEncoders();
                    using (EncoderParameters encoderParameters = new EncoderParameters(1))
                    {
                        encoderParameters.Param[0] = new EncoderParameter(Encoder.Quality, 90L);
                        bitmap.Save(targetImageFilePath, arrImageCodecInfo[1], encoderParameters);
                    }
                }
                else
                {
                    throw new Exception($"Convert to <{imageFormatToConvert.ToString()}> from " +
                                        $"<{new ImageFormatConverter().ConvertToString(image.RawFormat)}>" +
                                        $" image format is not supported now.");
                }
            }
        }
    }

```