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.
@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.
@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).