none
JPEG image re-save is not working in Linux OS RRS feed

  • Question

  • When tried to re save a JPEG image using System.Drawing provides an output JPEG image with different color in Linux Operating System. It works fine in Windows operating system. I have used .Net Core console project to implement the same using the following C# code snippet.

    using System;
    using System.IO;
    using System.Drawing;
    
    namespace ImageExtracter
    {
        class Program
        {
            static void Main(string[] args)
            {
                Image image = Image.FromFile("Input_Image.jpeg");
                Stream stream = new MemoryStream();
                image.Save(stream, image.RawFormat);
                stream.Position=0;
                Image img = Image.FromStream(stream);
                img.Save("Output_Image.jpeg", img.RawFormat);
            }
        }
    }

    Please find the images below.

    Input_Image.jpeg

    Input JPEG image

    Output_Image.jpeg

    Output JPEG image



    Monday, January 6, 2020 12:13 PM

All replies

  • Hi DeepakG211,
    Base on your description, it is recommended to go to GitHub and you can get more professional answer.
    Thank you for your understanding.
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 7, 2020 8:15 AM
  • For Linux & Windows & Intel based pc,look at Intels downloads/software.

    https://downloadcenter.intel.com/search?keyword=Linux

    Re-edit search for more Linux

    Sunday, January 12, 2020 4:55 AM