The dark slice problem in the Nifti formant?

Hello everyone, first of all.

I am dealing with a cbct image in nii.gz format. This image has a filling in one tooth. When I save these slices in png format, I get a dark image. However, other slices turn into png format in a normal way. When I open it in the 3D slicer application, the colors and everything else look very good. How can I save these slices in png format with python as good as in 3D Slicer? Do I need to apply a filter to nifti?

Thank you in advance for your help.