I thought I would add to this. If you are looking to scale a bitmap, try this:
var bmp = new Bitmap(newWidth, newHeight);
using var g = Graphics.FromImage(bmp);
g.SmoothingMode = SmoothingMode.None;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.CompositingQuality = CompositingQuality.AssumeLinear;
g.DrawImage(Image, new Rectangle(0, 0, newWidth, newHeight));
return bmp;
Make sure to set the interpolation mode to Nearest neighbor, remove smoothing, and high quality pixel offset. Assume it is a linear scale. For best results, make the new width/height an integer multiple of the original.