Browse our Products

Aspose.Imaging for .NET 17.9 - Release Notes

KeySummaryCategory
IMAGINGNET-2439Add possibility to force fonts cache updateFeature
IMAGINGNET-2376Support for CMYK, YCCK color modes in JPEG Lossless.Feature
IMAGINGNET-2143Implementation of Lossy GIF Compressor Feature
IMAGINGNET-2473When saving a tiff file with a different resolution the frames in the image are not displayed correctlyEnhancement
IMAGINGNET-2471Improve performance of DNG partial processingEnhancement
IMAGINGNET-2464Examine and fix partial processing of JPEG 2000 formatEnhancement
IMAGINGNET-2461Add support for PSD multiple fonts rendering and other possible style options within a single text layerEnhancement
IMAGINGNET-2458Fix exception when PSD text layer update is performed on previously saved PSD with updated text layer, using RemoveGlobalTextEngineResource optionEnhancement
IMAGINGNET-2453Optimize algorithm FloydSteinbergDitheringEnhancement
IMAGINGNET-2446Need investigate and support multiple fonts for text layers in PSDEnhancement
IMAGINGNET-2443Examine and fix partial PSD processing during exportEnhancement
IMAGINGNET-2442Investigate performance of JPEG when partial processingEnhancement
IMAGINGNET-2438Different SVG image sizes when local and server buildEnhancement
IMAGINGNET-2436Aspose.Imaging 17.6.0: Invalid rendering of particular SVG image into JPG, PNG and BMP formatsEnhancement
IMAGINGNET-2433Evaluation watermark appears when create TIFF document with VentureLicenserEnhancement
IMAGINGNET-2432Updating text makes text layer to moveEnhancement
IMAGINGNET-2427Unable to get width and height of DNG imageEnhancement
IMAGINGNET-2423Exception when exporting PSD image without licenseEnhancement
IMAGINGNET-2422Corrupted, partially or completely invisible watermark for particularly saved images.Enhancement
IMAGINGNET-2395Image transparency is improperly rendered in generated PNGEnhancement

Public API changes:

Added APIs:

Class Aspose.Imaging.FileFormats.Psd.LeadingMode Class Aspose.Imaging.FileFormats.Psd.PsdImage.PartialPixelLoader Class Aspose.Imaging.Image.ImageOperation Class Aspose.Imaging.ImageLoadOptions.SvgLoadOptions Class Aspose.Imaging.ImageOptions.TiffOptionsUtils Class Aspose.Imaging.OpenTypeFontsCache Class Aspose.Imaging.RasterImage.PartialPixelLoader Field/Enum Aspose.Imaging.DataStreamSupporter.Timeout Field/Enum Aspose.Imaging.FileFormats.Psd.LeadingMode.Auto Field/Enum Aspose.Imaging.FileFormats.Psd.LeadingMode.Manual Field/Enum Aspose.Imaging.Image.ImageOperation.AdjustBrightness Field/Enum Aspose.Imaging.Image.ImageOperation.AdjustContrast Field/Enum Aspose.Imaging.Image.ImageOperation.AdjustGamma Field/Enum Aspose.Imaging.Image.ImageOperation.BinarizeBradley Field/Enum Aspose.Imaging.Image.ImageOperation.BinarizeFixed Field/Enum Aspose.Imaging.Image.ImageOperation.BinarizeOtsu Field/Enum Aspose.Imaging.Image.ImageOperation.Crop Field/Enum Aspose.Imaging.Image.ImageOperation.Filter Field/Enum Aspose.Imaging.Image.ImageOperation.Grayscale Field/Enum Aspose.Imaging.Image.ImageOperation.LoadPixels Field/Enum Aspose.Imaging.Image.ImageOperation.Resize Field/Enum Aspose.Imaging.Image.ImageOperation.ResizeHeightProportionally Field/Enum Aspose.Imaging.Image.ImageOperation.ResizeWidthProportionally Field/Enum Aspose.Imaging.Image.ImageOperation.Rotate Field/Enum Aspose.Imaging.Image.ImageOperation.RotateFlip Field/Enum Aspose.Imaging.Image.ImageOperation.SavePixels Field/Enum Aspose.Imaging.RasterImage.PartialPixelLoader.pixelLoader Field/Enum Aspose.Imaging.RasterImage.PartialPixelLoader.pixelProcessor Method Aspose.Imaging.ColorPaletteHelper.GetCloseImagePalette(Aspose.Imaging.RasterImage,Aspose.Imaging.Rectangle,System.Int32) Method Aspose.Imaging.FileFormats.Bmp.BmpImage.GetDefaultOptions(System.Object[]) Method Aspose.Imaging.FileFormats.Bmp.BmpImage.ToBitmap Method Aspose.Imaging.FileFormats.Emf.EmfImage.GetDefaultOptions(System.Object[]) Method Aspose.Imaging.FileFormats.Emf.MetaImage.GetCanNotSaveMessage(Aspose.Imaging.ImageOptionsBase) Method Aspose.Imaging.FileFormats.Png.PngImage.GetDefaultOptions(System.Object[]) Method Aspose.Imaging.FileFormats.Psd.PsdImage.PartialPixelLoader.#ctor(Aspose.Imaging.IRasterImageArgb32PixelLoader,Aspose.Imaging.IPartialArgb32PixelLoader) Method Aspose.Imaging.FileFormats.Psd.PsdImage.PartialPixelLoader.Process(Aspose.Imaging.Rectangle) Method Aspose.Imaging.FileFormats.Webp.WebPImage.DoUseRecursion(Aspose.Imaging.Image.ImageOperation) Method Aspose.Imaging.FileFormats.Wmf.WmfImage.GetDefaultOptions(System.Object[]) Method Aspose.Imaging.Image.DoUseRecursion(Aspose.Imaging.Image.ImageOperation) Method Aspose.Imaging.Image.GetCanNotSaveMessage(Aspose.Imaging.ImageOptionsBase) Method Aspose.Imaging.Image.GetDefaultOptions(System.Object[]) Method Aspose.Imaging.Image.GetImage2Export(Aspose.Imaging.ImageOptionsBase) Method Aspose.Imaging.ImageCreatorsRegistry.Register(Aspose.Imaging.IImageCreatorDescriptor) Method Aspose.Imaging.ImageExportersRegistry.Register(Aspose.Imaging.IImageExporterDescriptor) Method Aspose.Imaging.ImageLoadersRegistry.GetFirstSupportedDescriptorByFileFormat(Aspose.Imaging.FileFormat) Method Aspose.Imaging.ImageLoadersRegistry.Register(Aspose.Imaging.IImageLoaderDescriptor) Method Aspose.Imaging.ImageLoadOptions.SvgLoadOptions.#ctor Method Aspose.Imaging.ImageOptions.TiffOptionsUtils.#ctor Method Aspose.Imaging.ImageOptions.TiffOptionsUtils.GetValidTagsCount(Aspose.Imaging.FileFormats.Tiff.TiffDataType[]) Method Aspose.Imaging.OpenTypeFontsCache.UpdateCache Method Aspose.Imaging.RasterImage.CreatePartialPixelLoader(Aspose.Imaging.IRasterImageArgb32PixelLoader,Aspose.Imaging.IPartialArgb32PixelLoader) Method Aspose.Imaging.RasterImage.DoUseRecursion(Aspose.Imaging.Image.ImageOperation) Method Aspose.Imaging.RasterImage.LoadRawData(Aspose.Imaging.Rectangle,Aspose.Imaging.Rectangle,Aspose.Imaging.RawDataSettings,Aspose.Imaging.IPartialRawDataLoader) Method Aspose.Imaging.RasterImage.PartialPixelLoader.#ctor(Aspose.Imaging.IRasterImageArgb32PixelLoader,Aspose.Imaging.IPartialArgb32PixelLoader) Method Aspose.Imaging.RasterImage.PartialPixelLoader.Process(Aspose.Imaging.Rectangle) Method Aspose.Imaging.RasterImage.ToBitmap Property Aspose.Imaging.FileFormats.Dicom.DicomImage.FileFormat Property Aspose.Imaging.FileFormats.Djvu.DjvuImage.FileFormat Property Aspose.Imaging.FileFormats.Dng.DngImage.FileFormat Property Aspose.Imaging.FileFormats.Emf.EmfImage.FileFormat Property Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock.FileFormat Property Aspose.Imaging.FileFormats.Gif.GifImage.FileFormat Property Aspose.Imaging.FileFormats.Jpeg.JpegImage.FileFormat Property Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Image.FileFormat Property Aspose.Imaging.FileFormats.Png.PngImage.FileFormat Property Aspose.Imaging.FileFormats.Psd.PsdImage.FileFormat Property Aspose.Imaging.FileFormats.Svg.SvgImage.FileFormat Property Aspose.Imaging.FileFormats.Tiff.TiffImage.FileFormat Property Aspose.Imaging.FileFormats.Webp.WebPImage.FileFormat Property Aspose.Imaging.FileFormats.Wmf.WmfImage.FileFormat Property Aspose.Imaging.Image.FileFormat Property Aspose.Imaging.ImageLoadOptions.SvgLoadOptions.DefaultHeight Property Aspose.Imaging.ImageLoadOptions.SvgLoadOptions.DefaultWidth Property Aspose.Imaging.ImageOptions.GifOptions.MaxDiff

Removed APIs:

Nothing

Usage examples:

IMAGINGNET-2439 Add possibility to force fonts cache update

 // Use it in case any OpenType fonts were installed or removed in the system while the library is constantly running

// By default, fonts cache is updated when PSD image with text layer is processed for the first time after library was loaded

OpenTypeFontsCache.UpdateCache();

IMAGINGNET-2376 Support for CMYK, YCCK color modes in JPEG Lossless.

 MemoryStream jpegStream = new MemoryStream();

try

{

// Save to JPEG Lossless CMYK

using (JpegImage image = (JpegImage)Image.Load("056.jpg"))

{

JpegOptions options = new JpegOptions();

options.ColorType = JpegCompressionColorMode.Cmyk;

options.CompressionType = JpegCompressionMode.Lossless;

// The default profiles will be used.

options.RgbColorProfile = null;

options.CmykColorProfile = null;

image.Save(jpegStream, options);

}

// Load from JPEG Lossless CMYK

jpegStream.Position = 0;

using (JpegImage image = (JpegImage)Image.Load(jpegStream))

{

image.Save("056_cmyk.png", new PngOptions());

}

}

finally

{

jpegStream.Dispose();

}
 MemoryStream jpegStream = new MemoryStream();

FileStream rgbProfileStream = new FileStream("eciRGB_v2.icc", FileMode.Open);

FileStream cmykProfileStream = new FileStream("ISOcoated_v2_FullGamut4.icc", FileMode.Open);

Sources.StreamSource rgbColorProfile = new Sources.StreamSource(rgbProfileStream);

Sources.StreamSource cmykColorProfile = new Sources.StreamSource(cmykProfileStream);

try

{

// Save to JPEG Lossless CMYK

using (JpegImage image = (JpegImage)Image.Load("056.jpg"))

{

JpegOptions options = new JpegOptions();

options.ColorType = JpegCompressionColorMode.Cmyk;

options.CompressionType = JpegCompressionMode.Lossless;

// The custom profiles will be used.

options.RgbColorProfile = rgbColorProfile;

options.CmykColorProfile = cmykColorProfile;

image.Save(jpegStream, options);

}

// Load from JPEG Lossless CMYK

jpegStream.Position = 0;

rgbProfileStream.Position = 0;

cmykProfileStream.Position = 0;

using (JpegImage image = (JpegImage)Image.Load(jpegStream))

{

image.RgbColorProfile = rgbColorProfile;

image.CmykColorProfile = cmykColorProfile;

image.Save("056_cmyk_custom_profiles.png", new PngOptions());

}

}

finally

{

jpegStream.Dispose();

rgbProfileStream.Dispose();

cmykProfileStream.Dispose();

}

IMAGINGNET-2143 Implementation of Lossy GIF Compressor

 // Sets the maximum allowed pixel difference. If greater than zero, lossy compression will be used.

// Recommended value for optimal lossy compression is 80. 30 is very light compression, 200 is heavy.

GifOptions gifExport = new GifOptions();

gifExport.MaxDiff = 80;

using (Image image = Image.Load("anim_orig.gif"))

{

image.Save("anim_lossy-80.gif", gifExport);

}

IMAGINGNET-2473 When saving a tiff file with a different resolution the frames in the image are not displayed correctly

 string sourcePath = "Carelogic-12-08092017-3343.tif";

string outputPath;

using (TiffImage tiffImage = (TiffImage)Image.Load(sourcePath))

{

// The type of compression and bits per sample are not really important

TiffOptions saveOptions = new TiffOptions(TiffExpectedFormat.Default);

saveOptions.Compression = TiffCompressions.Lzw;

saveOptions.BitsPerSample = new ushort[] { 1 };

int count = 0;

foreach (TiffFrame frame in tiffImage.Frames)

{

outputPath = string.Format("part_{0}.tif", count++);

frame.Save(outputPath, saveOptions);

frame.Dispose();

}

}

IMAGINGNET-2471 Improve performance of Dng partial processing

 string outFileName = @"D:\result.tiff";

using (DngImage image = (DngImage)Image.Load(@"D:\berries-raw.dng"))

{

image.Save(

outFileName,

new TiffOptions(TiffExpectedFormat.TiffNoCompressionRgb));

}

IMAGINGNET-2461 Add support for PSD multiple fonts rendering and other possible style options within a single text layer

 using (PsdImage image = Image.Load("complex.psd") as PsdImage)

{

PngOptions pngOptions = new PngOptions();

pngOptions.ColorType = PngColorType.TruecolorWithAlpha;

image.Save("complex.png", pngOptions);

}

IMAGINGNET-2458 Fix exception when PSD text layer update is performed on previously saved PSD with updated text layer, using RemoveGlobalTextEngineResource option

 private void SavePsd(PsdImage image, string savePath)

{

image.Save(savePath, new PsdOptions()

{

RemoveGlobalTextEngineResource = true,

RefreshImagePreviewData = true,

CompressionMethod = CompressionMethod.RLE

});

}

private void UpdateFirstTextLayer(Layer[] layers, string updateText)

{

for (int i = 0; i < layers.Length; i++)

{

if (layers[i] is TextLayer)

{

TextLayer layer = (TextLayer)layers[i];

layer.UpdateText(updateText);

break;

}

}

}

void CheckException()

{

PsdLoadOptions loadOptions = new PsdLoadOptions() { LoadEffectsResource = true, UseDiskForLoadEffectsResource = true };

using (PsdImage input = Image.Load("input.psd", loadOptions) as PsdImage)

{

Layer[] layers = input.Layers;

UpdateFirstTextLayer(layers, "test1");

SavePsd(input, "test1.psd");

}

using (PsdImage input = Image.Load("test1.psd", loadOptions) as PsdImage)

{

Layer[] layers = input.Layers;

UpdateFirstTextLayer(layers, "test2");

SavePsd(input, "test2.psd");

}

}

IMAGINGNET-2446 Need investigate and support multiple fonts for text layers in PSD

 using (PsdImage image = Image.Load("MSFT_DevEva_Web_Twitter-800x320_2-DVG.PSD", new PsdLoadOptions() { LoadEffectsResource = true, UseDiskForLoadEffectsResource = true }) as PsdImage)

{

PngOptions pngOptions = new PngOptions();

pngOptions.ColorType = PngColorType.TruecolorWithAlpha;

image.Save("MSFT_DevEva_Web_Twitter-800x320_2-DVG_output.png", pngOptions);

}

IMAGINGNET-2438 Different Svg image sizes when local and server build

 const string inputFile = @"D:\necker-cube-3.svg";

const int width = 500;

const int height = 500;

using (Image image = Image.Load(inputFile, new SvgLoadOptions() { DefaultWidth = width, DefaultHeight = height }))

{

if (width!=image.Width || height!=image.Height)

{

throw new Exception("Error: a sizes not equal");

}

}

Console.WriteLine("The test execute is successfully!");

IMAGINGNET-2436 Aspose.Imaging 17.6.0: Invalid rendering of particular SVG image into JPG, PNG and BMP formats

 string inputFile = @"D:\necker-cube-3.svg";

string outputFile = @"D:\necker-cube-3.png";

using (Image image = Image.Load(inputFile, new SvgLoadOptions() { DefaultWidth = 500, DefaultHeight = 500 }))

{

PngOptions options = new PngOptions();

options.VectorRasterizationOptions = new SvgRasterizationOptions() { PageSize = image.Size };

image.Save(outputFile, options);

}

IMAGINGNET-2432 Updating text makes text layer to move

Text layer pixel shift example

 using (PsdImage input = Image.Load("LogoFarbe_TB_Group.psd") as PsdImage)

{

PngOptions pngOptions = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha };

input.Save("resultSaveToPng.png", pngOptions);

foreach (Layer layer in input.Layers)

{

if (layer is TextLayer)

{

TextLayer tLayer = layer as TextLayer;

tLayer.UpdateText("TEST1 TEST2");

}

}

input.Save("resultUpdateText.png", pngOptions);

}

IMAGINGNET-2427 Unable to get width and height of DNG image

 string path = "013ECC66.TIF";

using (TiffImage tiffImage = (TiffImage)Image.Load(path))

{

int height = tiffImage.Height;

int width = tiffImage.Width;

Console.WriteLine("Width = " + width);

Console.WriteLine("Height = " + height);

}

IMAGINGNET-2422 Corrupted, partially or completely invisible watermark for particularly saved images.

 // IMPORTANT! Don't set any valid license to see the watermark!

Aspose.Imaging.License license = new Aspose.Imaging.License();

license.SetLicense(string.Empty);

string dir = @"C:\aspose.work\IMAGINGNET\2159\examples";

string sourceFileName = Path.Combine(dir, "lena24b.jls");

Rectangle[] rectangles = new Rectangle[]

{

new Rectangle(200, 100, 125, 300), // contains two diagonal lines instead of watermark

new Rectangle(200, 100, 155, 300), // contains the small watermark 126 x 32, text size 8pt

new Rectangle(200, 100, 194, 300), // contains the middle watermark 156 x 39, text size 10pt

new Rectangle(200, 100, 300, 300) // contains the big watermark 195 x 47, text size 12pt

};

for (int i = 0; i < rectangles.Length; ++i)

{

using (Image image = Image.Load(sourceFileName))

{

string outputFileName = Path.Combine(dir, "Watermark" + rectangles[i].ToString() + ".png");

image.Save(outputFileName, new PngOptions(), rectangles[i]);

}

}

IMAGINGNET-2395 Image transparency is improperly rendered in generated PNG

 PngOptions saveOptions = new PngOptions();

saveOptions.ColorType = PngColorType.TruecolorWithAlpha;

using (Image image = Image.Load("Gray.psd"))

{

image.Save("Gray.psd.png", saveOptions);

}