You need to cycle through the image pixel by pixel (in red) and set it's opacity, i've done it on here to "watermark" the footer.
You need the quantizer classes from MSDN to optimize the image, here's my code from the above site
public void Scale(int width, int height)
{
OctreeQuantizer quantizer = new OctreeQuantizer(255, 8);
Bitmap thumb = new Bitmap(width, height);
Graphics g = Graphics.FromImage(thumb);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(image, new Rectangle(0,0,thumb.Width,thumb.Height),0,0,image.Width,image.Height,GraphicsUnit.Pixel);
image.Dispose();
if (_text.Length > 0)
{
Font font = new Font("Verdana", 8, FontStyle.Bold);
Bitmap watermark = new Bitmap(thumb.Width, 20);
Graphics g2 = Graphics.FromImage(watermark);
g2.FillRectangle(
new SolidBrush(Color.Black),
new RectangleF(0, 0, watermark.Width, watermark.Height));
g2.DrawString(_text, font, new SolidBrush(Color.White), 1, 3);
g2.Dispose();
Color color;
for (int py = 0; py < watermark.Height; py++)
{
for (int px = 0; px < watermark.Width; px++)
{
color = watermark.GetPixel(px, py);
watermark.SetPixel(px, py, Color.FromArgb(96, color.R, color.G, color.B));
}
}
g.DrawImage(watermark, 0, thumb.Height - 20);
}
g.DrawRectangle(new Pen(Color.Black), 0, 0, thumb.Width - 1, thumb.Height - 1);
g.Dispose();
Bitmap quantized = quantizer.Quantize(thumb);
thumb.Dispose();
HttpContext.Current.Response.ContentType = "image/gif";
quantized.Save(HttpContext.Current.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
quantized.Dispose();
}