Imaging resizing causes grainy output in C#
<p>I'm trying to resize an image uploaded through an MVC3 app. The code below is able to resize the image based on my target sizes based on the parameter specified, however the end result is a grainy image. I've tried a lot of different solutions here in stackoverflow and msn samples but everything returns a grainy image.</p>

<pre><code>static public Image ResizeFile(HttpPostedFileBase file, int targeWidth, int targetHeight)
    {
        Image originalImage = null;
        bool IsImage = true;
        Bitmap bitmap = null;

        try
        {
            originalImage = Image.FromStream(file.InputStream, true, true);
        }
        catch
        {
            IsImage = false;
        }

        if (IsImage)
        {
            //accept an image only if it is less than 3mb(max)
            if (file.ContentLength &lt;= 3145728)
            {
                var newImage = new MemoryStream();
                Rectangle origRect = new Rectangle(0, 0, originalImage.Width, originalImage.Height);

                // if targets are null, require scale. for specified sized images eg. Event Image, or Profile photos.
                int newWidth = 0;
                int newHeight = 0;

                //if the width is greater than height
                if (originalImage.Width &gt; originalImage.Height)
                {
                    newWidth = targeWidth;
                    newHeight = targetHeight;
                    bitmap = new Bitmap(newWidth, newHeight);
                }

                //if the size of image is larger than either one of the target size
                else if (originalImage.Width &gt; targeWidth || originalImage.Height &gt; targetHeight)
                {
                    newWidth = targeWidth;
                    newHeight = targetHeight;
                    bitmap = new Bitmap(newWidth, newHeight);
                }
                //reuse old dimensions
                else
                {
                    bitmap = new Bitmap(originalImage.Width, originalImage.Height);
                }

                try
                {
                    using (Graphics g = Graphics.FromImage((Image)bitmap))
                    {
                        g.SmoothingMode = SmoothingMode.AntiAlias;
                        g.PixelOffsetMode = PixelOffsetMode.HighQuality;
                        g.CompositingQuality = CompositingQuality.HighQuality;
                        g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                        g.DrawImage(originalImage, new Rectangle(0, 0, newWidth, newHeight),
                            0,
                            0,           // upper-left corner of source rectangle
                            originalImage.Width,       // width of source rectangle
                            originalImage.Height,      // height of source rectangle
                            GraphicsUnit.Pixel);
                        bitmap.Save(newImage, ImageFormat.Jpeg);
                    }
                }
                catch (Exception ex)
                {   // error before IDisposable ownership transfer
                    if (bitmap != null)
                        bitmap.Dispose();

                    logger.Info("Domain/Utilities/ImageResizer-&gt;ResizeFile: " + ex.ToString());

                    throw new Exception("Error resizing file.");
                }
            }                
        }

        return (Image)bitmap;
    }
</code></pre>

<p><strong>UPDATE 1</strong>
removed parameters and encoders, currently saving in .jpeg. But still produces a grainy image.</p>
