Export png failed: failed to get graph rgb color data

I am seeking assistance with a problem I am facing while working on a project in the WSL Ubuntu 22.04 environment.
I successfully executed a source program named “Converter,” but when I attempt to save an image using my own C++ code, it fails. error: failed to get graph rgb color data
as the rest of the code executes without any problems. It can works in windows.

Here is a snippet of my C++ code related to image saving:

				string curFileName = fileBase + std::to_string(i) + ".png";
				exporter.WritePNG(curFileName.c_str(), pngOutPut.xres, pngOutPut.yres, pngOutPut.backgroundColor, pngOutPut.cameraOverride,
													size_diraction[i], pngOutPut.fitWorldExact, pngOutPut.enableHiddenLine, pngOutPut.enableTransparentBackground,
													pngOutPut.exportPmi, pngOutPut.renderingMode, pngOutPut.lightingMode);

If anyone has encountered a similar issue or has any suggestions on how to resolve this, please let me know. I would greatly appreciate your help.

Hey there, thanks for reaching out. I see a similar case in support so I’ll check that out. Perhaps @beau.trifiro or @Toshi-TS3D may be able to help.

Are you in a current evaluation and do you know if your license is still active?

Most Linux-based servers are not set up for 3D graphics rendering by default. Many operations, such as converting certain types of files and creating PNG images, require that an X server and additional graphics libraries are available.
The recommended approach for using HOOPS Converter on Linux servers without graphics hardware is to utilize Xvfb.
Please refer the Running in a “Headless” Linux environment section in the following link:

1 Like