图片压缩命令行工具 png压缩 有损压缩 压缩
2021-08-05 17:00:59 386KB 图片压缩 png压缩 有损压缩 压缩
1
pngquant 压缩图片 c++ 源码
2021-08-05 14:00:39 146KB pngquant 压缩图片 图片压缩 c++
1
很好用的png压缩工具,无损压缩比达50%以上. 使用方法:将图片放到工具目录下,双击bat文件,即可批量压缩图片。
2021-04-30 10:39:18 205KB pngquant png压缩 PNG批量压缩
1
在Startup.cs文件中配置Pngquant所在路径 public void ConfigureServices(IServiceCollection services) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { var pngquant = Configuration.GetSection("PngquantPathLinux").Value; PngquantConfig.Configure(new PngquantOptions { BinaryFolder = pngquant }); } if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var pngquant = Configuration.GetSection("PngquantPathWin").Value; PngquantConfig.Configure(new PngquantOptions { BinaryFolder = pngquant }); } } 使用: FileStream fs = new FileStream(filePath, FileMode.Open); byte[] byData = new byte[fs.Length]; //设置压缩选项 var options = new PngQuantOptions() { QualityMinMax = (65, 80), //Minimum = 65, Maximum = 80. Default null Speed = 1, //Value between 1 and 11. default 3. IEBug = false, //Attempt to fix iebug. default false. Bit = 256 //bit-rate. default 256 }; ///Invoke the compressor Compressor pngQuant = new PngQuant(options); //Compress bytes byte[] compressed = await pngQuant.Compress(byData); MemoryStream ms = new MemoryStream(compressed); //把那个byte[] 数组传进去, 然后 using (FileStream fs = new FileStream(savePath, FileMode.Create, FileAccess.Write)) ms.WriteTo(fs);
2021-04-29 01:38:23 64KB Pngquant C# .netcore
1