Why does .png converted from gnuplot postcript output have a transparent background?

I used gnuplot (4.2) to write the graph to a postscript file. But when I convert this .ps file to a .png file using the command "convert file.ps file.png", I get a png image that has no background (transparent).

Why is this happening, and how do I get a PNG image with a white background?

+3
source share
2 answers

"Why is this happening?"

Two possible reasons:

-:. PostScript . , "". . ( PostScript , . , "background", . , , PS...)

: convert a.ps a.png . "", Ghostscript. Ghostscript PNG. Ghostscript all "" :

gs -h

, PNG :

gs -h | grep png

, pngalpha. PNG.

convert :

convert -list delegate

, convert , . , PNG:

convert -list delegate | grep -i png

, gs ... -sDEVICE=pngalpha ... .

" png- ?"

:

convert a.ps -background white a.png
+4

Pipitas , .

, , -alpha off convert. , -density x. , - :

convert -density 300 -alpha off input.ps output.png

0

Source: https://habr.com/ru/post/1764266/


All Articles