0
我想改變我的TIFF文件的分辨率提高了文件的大小,它是使用下面的代碼修改成功,但它是繪製調整大小TIFF圖像使用C#
後增加從74KB到828KB我的輸出文件大小代碼中使用:
public void Resize(string imageFile, string outputFile, int width,int height)
{
using (var srcImage = Image.FromFile(imageFile))
{
var newWidth = (int)(width);
var newHeight = (int)(height);
using (var newImage = new Bitmap(newWidth, newHeight))
{
using (var graphics = Graphics.FromImage(newImage))
{
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
graphics.PixelOffsetMode = PixelOffsetMode.None;
graphics.DrawImage(srcImage, new Rectangle(0, 0, newWidth, newHeight));
newImage.Save(outputFile,ImageFormat.Tiff);
}
}
}
}
沒有同時使用Graphics.FromImage(文件名)增加文件大小,之後也使用編碼器參數。 –
你的新舊尺碼是?輸入是否也是TIFF格式,如果是這樣,使用什麼壓縮? –