While Convert JPG to SVG - the SVG image should not contains 'Base64'

Hi Aspose,

While converting Microsoft chat control’s to JPG file to SVG, The SVG file contains ‘ With Base64’.
Actually we want exact SVG rendering instead of SVG with Base64.

Input: 638424825698838321_output.jpg (23.3 KB)
Output:
image.png (76.8 KB)
638424825699138320_output.zip (67.2 KB)
Sample: Sample.zip (1.8 KB)

Could You Please resolve the Issue?

Thanks

@msindia Do I understand you correctly, would you like to get a vector svg from a jpeg format?

Hi @stanislav.popov ,

Yes. You are right.

Thanks

@msindia , This functionality is not provided in the Aspose.Imaging library. To do this, check out the Aspose.Cad product.

Hi @stanislav.popov ,
Could you please provide the sample or reference?

Thanks

@msindia , A specialist from the Aspose.CAD team will contact you shortly.

@msindia,
Hi.
You can try to use something like this with Aspose.CAD:

 LoadOptions loadOptions = new LoadOptions();
 loadOptions.VectorizationOptions = new VectorizationOptions();
 loadOptions.VectorizationOptions.PaperToCadOptions = new PaperToCadOptions();

 loadOptions.VectorizationOptions.PaperToCadOptions.ColorsCluzterization = 0.001f;

 using (Image image = Aspose.CAD.Image.Load("638424825698838321_output.jpg", loadOptions))
 {
     CadRasterizationOptions rasterOptions = new CadRasterizationOptions();
     rasterOptions.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor;

     SvgOptions options = new SvgOptions();
     options.TextAsShapes = false;
     options.VectorRasterizationOptions = rasterOptions;
     image.Save("result.svg", options);
 }

But unfortunately, the quality of resulting SVG is not very good. We will consider possible improvements for this case in the scope of CADNET-9630. We are sorry for the inconvenience.

1 Like

Hi @oleksii.gorokhovatskyi ,

Thank you for the sample.

Waiting for the fix CADNET-9630

@msindia,
Just some additional information, as we found this problem to be quite complex because file contains small text with a lot of shades of gray (expecially around the text). If it is possible to generate the input file in better size or quality, this is the best option we can have.

We also have tried to preprocess the image using Aspose.Imaging:

using (Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)Aspose.Imaging.Image.Load("638424825698838321_output.jpg"))
{
rasterImage.ReplaceColor(Aspose.Imaging.Color.Black, 150, Aspose.Imaging.Color.Black);
rasterImage.Save("improved.png", new Aspose.Imaging.ImageOptions.PngOptions());
}

// futher processing of the improved image with Aspose.CAD

and we find results better, but there are still issues with text. We have tried Inkscape to vectorize this image and had no success too, probably, satisfactory export will require some exact settings and values (if this is possible at all). E.g., result is better with loadOptions.VectorizationOptions.PaperToCadOptions.ColorsCluzterization = 0.000745f (compared to 0.001 without preprocessing).