Free Support Forum -

Converting STL file to PNG file with smooth color/shading


Converting STL file to PNG file produces a PNG file with wireframe surface of the front.
Is there a way to convert STL to PNG with smooth or flat surface color or nearly smooth/flat just like the original?

Attached is the original STL and converted PNG. (39.1 KB) (94.4 KB)


I attached the expected PNG file converted from STL file.
I just screenshot this from original STL. (19.0 KB)

This is what I want as end result.
Not the lines crisscrossing.

Is this possible?


Can you please share the source code that you have used along with API version that you have tried.

@mudassir.fayyaz, thanks for prompt reply…

I just followed the usual demo code for STL to PNG conversion.

Regarding API version, I used Aspose-cad:20.7

AsposeVersion.JPG (16.4 KB)

  void convertStlToPng(File sourceFile, File targetFile) {
    try {
        var image = (CadImage) Image.load(sourceFile.toString());

        // Create an instance of CadRasterizationOptions and set its various properties
        CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();

        // Create an instance of PngOptions
        PngOptions pngOptions = new PngOptions();

        // Set the VectorRasterizationOptions property
        // Export the STL to PNG,pngOptions);
    catch (Exception e)
        throw new RuntimeException(e);

basically when I convert an STL file to PNG file, the following happens:

  1. Converted PNG file has the STL image but the surface disappeared.
    Only lines crisscrossing.

Is there a way for the surface to remain when converting STL to PNG or any other image format?


Can you please try using the latest version and if the issue is still reproduced then please share the source STL and generated PNG file with us for investigation and resolution on our end.


I have tried with the latest version, the issue still happens.
Attached is the source STL and generated PNG file. (94.4 KB) (39.1 KB)


I have created the issue with ID CADNET-8044 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.