彩票走势图

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

原创|产品更新|编辑:李显亮|2020-09-29 09:49:11.880|阅读 267 次

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

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

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

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

近期发布了Aspose.Imaging for .NET v20.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 File?
The 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 settings
The 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 image
To 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 image
To 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 image
For 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 compression
The 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技术交流群(642018183),我们很高兴为您提供查询和咨询

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn


为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP