I use Graphics.DrawString Method to write a text on image,
but the text quality become too low after saving image.
this id my code:
Bitmap bitMapImage = new System.Drawing.Bitmap(Server.MapPath("~/k32.jpg"));
Graphics graphicImage = Graphics.FromImage(bitMapImage);
graphicImage.DrawString("string", font, s, new Point(10, 10));
graphicImage.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphicImage.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
graphicImage.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
graphicImage.TextContrast = 0;
Response.ContentType = "image/jpeg";
bitMapImage.Save(Server.MapPath("~/k33.jpg"), ImageFormat.Jpeg);
How can I improve the text quality?
Thanks
You can try using a lossless image format:
Or if you really want to stick with jpeg then you can try adjusting the JPEG compression level by referring to this MSDN How to: Set JPEG Compression Level