Content missing while converting BMP to PNG using Aspose.Imaging for .NET

Hi,

Data loss after conversion - converting bmp,gif to png

Below Code is used-
public void ConvertToPng(string sourcePath, string destinationPath)
{
using (var image = Image.Load(sourcePath))
{
var saveOptions = new PngOptions();
image.Save(destinationPath, saveOptions);
}
}

PFA origional input file and output file.
InputImage.gif (7.9 KB)
OutputImage.png (6.7 KB)

Please suggest.

@harsh1691,

I have worked with source files and sample code shared by you using Aspose.Imaging for .NET 17.12 and unable to observe any issue. Can you please share screen shot pointing to issue along with environment details and Aspose.Imaging version so that we may further investigate to help you out.OutputImage.png (7.2 KB)

I am using Aspose.Imaging 17.12.0 version.
Please find below output png image screen shot for same earlier input image-
image.png (33.2 KB)

Please suggest.

@harsh1691,

I have observed your comments. I am unable to observe any issue you specified in screenshot. Can you please share complete environment details so that we may further investigate to help you out.

My Development Environment :

  • OS- Windows Server 2012 R2
  • Visual studio 2015 v14.0 update 2
  • .NET framework v4.7

@harsh1691,

I have worked with the source file shared by you and have been able to observe the issue. An issue with ID IMAGINGNET-2841 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed. We will share good news with you soon.

Any updates on this issue?

@harsh1691,

I have observed your comments. I regret to inform that issue is still unresolved. I have requested our product team to share ETA regarding this issue. I request for your patience until further feedback is shared by them.

@Adnan.Ahmad,

Any updates on this issue?

@harsh1691,

I have observed your comments. Can you please try to use below sample code. This will help you to achieve requirements. Please share feedback with us if there is still an issue.

string dir = @“c:\aspose.work\IMAGINGNET\2841”;

using (GifImage image = (GifImage)Image.Load(dir + “InputImage.gif”))
{
PngOptions options = new PngOptions();

if (image.HasTransparentColor && image.TransparentColor == image.BackgroundColor)
{
// Use TruecolorWithAlpha to omit the tRNS transparency chunk,
// so the black color won’t be considered as transparent in the output PNG.
options.ColorType = Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha;
}

image.Save(dir + “OutputImage_Case2_TruecolorWithAlpha.png”, options);
}