🛠️ToolsShed

SVG→PNG変換

SVGベクターファイルを任意の解像度のPNGラスター画像に変換します。

よくある質問

コード実装

# Using CairoSVG
import cairosvg

# Basic conversion
cairosvg.svg2png(url="input.svg", write_to="output.png")

# With custom output size (scale 2x for high-DPI)
cairosvg.svg2png(
    url="input.svg",
    write_to="output@2x.png",
    scale=2.0
)

# With explicit pixel dimensions
cairosvg.svg2png(
    url="input.svg",
    write_to="output_800.png",
    output_width=800,
    output_height=600
)

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.