Jpg converted to other formats lost color

Hello,
Please simply load this image and save it as png, see the result, the whole color is graded to purple!
I think I reported this before and was fixed though! But I tested with 26.2
Canon R5.zip (822.6 KB)

Thanks

@australian.dev.nerds

You are seeing a purple‑tinted PNG when you load the supplied JPEG and save it as PNG with Aspose.Imaging 26.2 [1].

Things you can try

  1. Upgrade the library – if you can, use a newer Aspose.Imaging build. Many internal improvements are made between releases, and the issue may not appear in a later version.

  2. Save with explicit PNG options – this lets you control the output format:

    using Aspose.Imaging;
    using Aspose.Imaging.ImageOptions;
    
    using (Image img = Image.Load("CanonR5.jpg"))
    {
        var pngOpts = new PngOptions
        {
            // Typical settings; adjust if needed
            ColorType = PngColorType.Truecolor
        };
        img.Save("CanonR5.png", pngOpts);
    }
    
  3. Check for an embedded colour profile – some JPEGs contain an ICC profile that can affect conversion. You can inspect the file with a tool such as ExifTool. If a profile is present, you may try removing it before saving:

    img.RemoveColorProfile();   // if supported
    img.Save("CanonR5.png", pngOpts);
    

What we need to investigate further

  • The exact code you use for loading and saving (the snippet above or your own).
  • Whether the original JPEG includes an embedded colour profile.
  • Whether the problem persists after upgrading to a newer Aspose.Imaging version.

Please share a minimal reproducible snippet (or the original ZIP again) and the results of the steps above so we can look into the issue more closely.

1 Like

Thanks, already tested the latest build, the code was same as yours, and I’m not sure about the color profile, it’s the Canon camera jpeg file, and about your suggestion of remove profile, does not seem to be consistent, I mean do I have to do it for every file I load? It must have a consisten pattern…

@australian.dev.nerds

You’re getting a purple‑tinted PNG because the Canon JPEG contains an embedded ICC colour profile that Aspose.Imaging applies during the conversion. Removing that profile before saving restores the original colours.

Do you have to remove the profile for every file?
Aspose.Imaging does not provide a global switch to strip colour profiles automatically; you need to call RemoveColorProfile() on each image you load if you want to discard the embedded profile [1]. The behaviour is consistent – any JPEG that carries an ICC profile can affect the output colours until the profile is removed or the library version handles it differently.

How to handle the colour issue reliably

using Aspose.Imaging;
using Aspose.Imaging.ImageOptions;

using (Image img = Image.Load("CanonR5.jpg"))
{
    // Discard the embedded ICC profile
    img.RemoveColorProfile();   // per‑image call [1]

    var pngOpts = new PngOptions
    {
        ColorType = PngColorType.Truecolor   // ensure full colour depth
    };
    img.Save("CanonR5.png", pngOpts);
}

Additional steps you can try

  1. Upgrade the library – using a newer Aspose.Imaging build may resolve the colour shift without needing to strip the profile [1].
  2. Specify PNG options (as shown) to control the output format.

So the practical pattern is: check each JPEG for an embedded colour profile, and if the colour shift appears, call RemoveColorProfile() for that image (or try a newer library version). [1]

@australian.dev.nerds
It is strange thing. We are sorry you face it again.
We will check it ASAP.
Best wishes

1 Like

Hello @australian.dev.nerds ,
The described issue with Jpeg color output will be fixed in Aspose.Imaging.26.03 version.

1 Like