The quality of the changed elements in a picture is bad.

Hi, when I change a picture, the quality of the changed elements is very bad (see picture - the red elements). The origin picture itself has a good quality. Is it possible to increase the quality of the changed elements?

I save the picture so:


editorFront.ImageSaving += EditorFront_ImageSaving;

editorFront.Save(".png", editorFront.OriginalImageSize);


private void EditorFront_ImageSaving(object sender, Syncfusion.SfImageEditor.XForms.ImageSavingEventArgs args)

{

     args.Cancel = true; // Stop the image from saving to location

     imageData = GetImageStreamAsBytes(args.Stream);

     editorFront.ImageSaving -= EditorFront_ImageSaving;

}


private byte[] GetImageStreamAsBytes(Stream input)

{

       var buffer = new byte[16 * 1024];

       using (MemoryStream ms = new MemoryStream())

       {

            int read;

            while ((read = input.Read(buffer, 0, buffer.Length)) > 0)

            {

                ms.Write(buffer, 0, read);

            }

            return ms.ToArray();

      }

}


Thanks


Attachment: Screenshot_from_20220301_110458_7d5a542b.zip

1 Reply

ET Eswaran Thirugnanasambandam Syncfusion Team March 4, 2022 03:48 PM UTC

When saving an image in the SfImageEditor control, the drawn path, shape, text, and image are all converted as a single bitmap and saved as an image. As a result, there may be a minor quality difference while converting a bitmap to an image, although it will not be extremely low quality. Also, we recommend saving the image in JPG format to improve the quality of the image to be saved. 
 
Please refer the below user guide documentation link to know how to specify the format of the image to be saved. 


Loader.
Up arrow icon