您好,登錄后才能下訂單哦!
在.net中使用GDI+來提高gif圖片的保存畫質,這就是“Octree“ 算法。“Octree“ 算法允許我們插入自己的算法來量子化我們的圖像。
使用octreequantizer很方便:
system.drawing.bitmap b = new System.Drawing.Bitmap("c:\original_image.gif");
System.Drawing.Image thmbnail = b.GetThumbnailImage(100,75,null,new IntPtr());
OctreeQuantizer quantizer = new OctreeQuantizer ( 255 , 8 ) ;
using ( Bitmap quantized = quantizer.Quantize ( thmbnail ) )
{
quantized.Save("c:\thumnail.gif", System.Drawing.Imaging.ImageFormat.Gif);
}
octreequantizer grayquantizer = new GrayscaleQuantizer ( ) ;
using ( Bitmap quantized = grayquantizer.Quantize ( thmbnail ) )
{
quantized.Save("c:\thumnail.gif", System.Drawing.Imaging.ImageFormat.Gif);
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。