示例解读!图像处理控件Aspose.Imaging最新版新功能上线!支持PNG转TGA

图像处理库Aspose.Imaging for .NET更新至最新版v20.9,在Dicom导出器中支持Jpeg,Jpeg2000和RLE压缩方法,支持将PNG转换为TGA格式,以WebP格式实现对Exif块的支持。慧都提供安装包下载、中文教程、优惠购买等服务。

Aspose.Imaging for .NET是一种高级图像处理控件,允许开发人员创建,编辑,绘制或转换图像。图像导出和转换是API核心功能之一,它允许在不安装Photoshop应用程序或任何其他图像编辑器的情况下保存为AdobePhotoshop机格式。

事实证明,Aspose.Imaging是处理各种图像格式的强大API。除单页图像外,Aspose.Imaging还支持处理多页图像,包括GIF,TIFF,PSD,DICOM,CDR和WebP。

近期发布了Aspose.Imaging for .NETv20.9,在Dicom导出器中支持Jpeg,Jpeg2000和RLE压缩方法,支持将PNG转换为TGA格式,以WebP格式实现对Exif块的支持,修复保存SVG和TIFF时图像保存失败异常,还没使用过的朋友可以最新版Aspose.Imaging(安装包仅提供部分功能,并设置限制,如需试用完整功能请申请免费授权)

整合所有格式API处理控件Aspose永久授权正在网火热销售中,新购乐享85折起!联系客服立马1分钟了解全部咨询!

新增与改善

key 概述 类别
IMAGINGNET-4018 在Dicom导出器中支持Jpeg,Jpeg2000和RLE压缩方法 功能
IMAGINGNET-3615 将PNG转换为TGA格式 功能
IMAGINGNET-4071 以WebP格式实现对Exif块的支持 增强功能
IMAGINGNET-4067 导出PSD图像时不考虑Alpha通道 Bug修复
IMAGINGNET-4066 PsdExporter中未使用PsdOptions.XmpData属性 Bug修复
IMAGINGNET-4064 导出到EMF会以错误的比例缩放图像 Bug修复
IMAGINGNET-4063 导出到WMF会以错误的比例缩放图像 Bug修复
IMAGINGNET-4062 支持在TIFF导出器中从TiffOptions导出XMP元数据 增强功能
IMAGINGNET-4026 加载JPF时,索引超出了数组异常的范围 Bug修复
IMAGINGNET-4003 在保存数据时将CompressionLevel添加到PngOptions Bug修复
IMAGINGNET-3992 将栅格图像导出到图元文件的错误结果 Bug修复
IMAGINGNET-3990 导出几种矢量类型的图像时会发生NullReferenceException Bug修复
IMAGINGNET-3985 根据Aspose.Psd调整大小实施其他调整大小方法 Bug修复
IMAGINGNET-3958 保存TIFF时图像保存失败异常 Bug修复
IMAGINGNET-3954 保存SVG时图像保存失败异常 Bug修复
IMAGINGNET-3938 支持导出和导入到TGA文件格式 增强功能

用法示例

IMAGINGNET-4045 PSD导出器不支持压缩方法

// When exporting to PSD, options for compression, color type and bitness are available:using (Image image = Image.Load(SRC)){ // Export to PSD with RLE compression image.Save(DEST1, new PsdOptions() {  CompressionMethod = CompressionMethod.RLE }); // Export to PSD with RGB color type image.Save(DEST2, new PsdOptions() {  ColorMode = ColorModes.Rgb,  ChannelsCount = 3,  ChannelBitsCount = 8 });

IMAGINGNET-4067 导出PSD图像时不考虑Alpha通道

using (Image image = Image.Load("Progressive.png")){    image.Save("Progressive.png.psd", new PsdOptions()                                   {                                       CompressionMethod = CompressionMethod.RLE,                                       ColorMode = ColorModes.Rgb,                                       ChannelBitsCount = 8,                                       ChannelsCount = 4                                   });}

IMAGINGNET-4018 在Dicom导出器中支持Jpeg,Jpeg2000和RLE压缩方法

### What is a DICOM Image Filehe DICOM standard is useful for integrating all modern imaging equipments, accessories, networking servers, workstations and printers. Because of its ease of integration and continuous evolution this communication standard has over the years achieved a nearly universal level of acceptance among vendors of radiological equipment.A DICOM image file is an outcome of the Digital Imaging and Communications in Medicine standard. Specifically, image files that are compliant with part 10 of the DICOM standard are generally referred to as “DICOM format files” or simply “DICOM files” and are represented as “.dcm”.### DICOM compression settingsThe property ***DicomOptions.Compression*** allows you to specify compression settings. For instance, ***CompressionType*** enumeration allows you to select compression algorithm: *None*, *Jpeg*, *Jpeg2000* or *Rle*. The *None* option corresponds to uncompressed DICOM image. The following code shows how to use DICOM compression settings:using (var inputImage = Image.Load("original.jpg")){    var options = new DicomOptions    {        ColorType = ColorType.Rgb24Bit,        Compression = new Compression { Type = CompressionType.None }    };    inputImage.Save("original_Uncompressed.dcm", options);}### Using JPEG compression in DICOM imageTo use JPEG compression algorithm you should specify *CompressionType.Jpeg* enumeration value in ***Compression.Type*** property:using (var inputImage = Image.Load("original.jpg")){    var options = new DicomOptions    {        ColorType = ColorType.Rgb24Bit,        Compression = new Compression { Type = CompressionType.Jpeg }    };    inputImage.Save("original_JPEG.dcm", options);}You can tune JPEG compression algorithm using ***Compression.Jpeg*** property. For instance, you can specify the *CompressionType*, *SampleRoundingMode* and *Quality*:using (var inputImage = Image.Load("original.jpg")){    var options = new DicomOptions    {        ColorType = ColorType.Rgb24Bit,        Compression = new Compression        {            Type = CompressionType.Jpeg,            Jpeg = new JpegOptions            {                CompressionType = JpegCompressionMode.Baseline,                SampleRoundingMode = SampleRoundingMode.Truncate,                Quality = 50            }        }    };    inputImage.Save("original_JPEG_2.dcm", options);}### Using JPEG 2000 compression in DICOM imageTo use JPEG 2000 compression you need to use *CompressionType.Jpeg2000* enumeration value and ***Jpeg2000Options*** class for algorithm settings. The following code demonstrates how to specify JPEG 2000 *Codec* and *Irreversible* properties:using (var inputImage = Image.Load("original.jpg")){    var options = new DicomOptions    {        ColorType = ColorType.Rgb24Bit,        Compression = new Compression        {            Type = CompressionType.Jpeg2000,            Jpeg2000 = new Jpeg2000Options            {                Codec = Jpeg2000Codec.Jp2,                Irreversible = false            }        }    };    inputImage.Save("original_JPEG2000.dcm", options);}### Using RLE compression in DICOM imageFor this compression type you need to use *CompressionType.Rle* enumeration value. The RLE compression algorithm doesn't have additional settings. The following code shows how you can use RLE compression algorithm in DICOM image:using (var inputImage = Image.Load("original.jpg")){    var options = new DicomOptions    {        ColorType = ColorType.Rgb24Bit,        Compression = new Compression { Type = CompressionType.Rle }    };    inputImage.Save("original_RLE.dcm", options);}### How to change Color Type in DICOM compressionThe property ***DicomOptions.ColorType*** allows you to change color type in DICOM compression. There are several supported color types: *Grayscale8Bit*, *Grayscale16Bit* and *Rgb24Bit*. Use the following code in order to change the color type:using (var inputImage = Image.Load("original.jpg")){    var options = new DicomOptions { ColorType = ColorType.Grayscale8Bit };    inputImage.Save("original_8Bit.dcm", options);}


还想要更多吗可以点击阅读【2020 · Aspose最新资源整合】查找需要的教程资源。如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询
标签:

来源:慧都

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年8月26日
下一篇 2020年8月26日

相关推荐

发表回复

登录后才能评论