Home > Blockchain >  SVG background transparency
SVG background transparency

Time:12-23

I have an application in flight simulation to rotate an instrument needle with a completely transparent background. Photoshop has true transparent backgrounds but when I convert an SVG file to a PNG file (with File Converter), the background is always white in Photoshop, even setting opacity, etc. Is there any way to do this or does SVG export just RGB rather than RGBA?

CodePudding user response:

Thanks. If I convert the following SVG file to PNG with FileCoverter or ImageMagick, I get a red rectangle on a white background when I inspect the PNG file with Photoshop (version 12, which does not support SVG). What am I doing wrong?

<svg version="1.1"
    width="300" height="300"
    xmlns="http://www.w3.org/2000/svg">

<rect x="50" y="50" width="200" height="100" stroke="red" fill="red" />
</svg>

CodePudding user response:

I managed to set the background to transparent by opening the SVG file in Inkscape and exporting it as a PNG file. Photoshop then sees the transparent background.

  •  Tags:  
  • svg
  • Related