using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; namespace Sepialise_Me { public class Program { [STAThread] static void Main(string[] args) { ImageAttributes attribs = new ImageAttributes(); attribs.SetColorMatrix(SepiaMatrix()); Image bmp = Bitmap.FromFile(args[0]); Bitmap bmp2 = new Bitmap(bmp.Width, bmp.Height); using (Graphics g = Graphics.FromImage(bmp2)) { g.DrawImage(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attribs); } bmp2.Save(Path.GetFileNameWithoutExtension(args[0]) + "_sepia.jpg", ImageFormat.Jpeg); } private static ColorMatrix SepiaMatrix() { return new ColorMatrix( new float[][]{ new float[] {0.393f, 0.349f, 0.272f, 0, 0}, new float[] {0.769f, 0.686f, 0.534f, 0, 0}, new float[] {0.189f, 0.168f, 0.131f, 0, 0}, new float[] { 0, 0, 0, 1, 0}, new float[] { 0, 0, 0, 0, 1} }); } } }