# Converting from Vega Use the Vega functions for charts authored in Vega or already compiled to Vega from Vega-Lite. VlConvert parses and evaluates the specification directly, so the Vega-Lite `theme` and `vl_version` options do not apply. Available outputs: SVG, PNG, JPEG, PDF, HTML, a Vega Editor URL, and an evaluated scenegraph. Save this Vega specification: :::{dropdown} chart.vg.json :open: ```{literalinclude} /_examples/vega-demo.vg.json :language: json ``` ::: ```python from pathlib import Path import vl_convert as vlc vg_spec = Path("chart.vg.json").read_text(encoding="utf-8") svg = vlc.vega_to_svg(vg_spec) png = vlc.vega_to_png(vg_spec, scale=2) Path("chart.svg").write_text(svg, encoding="utf-8") Path("chart.png").write_bytes(png) ``` Vega functions also accept the specification as a dictionary. SVG and HTML functions return text. PNG, JPEG, and PDF functions return bytes. The SVG conversion renders this chart: ```{vl-chart} /_examples/vega-demo.vg.json :input-kind: vega :alt: Vega bar chart with five bars labeled A through E ``` Size, locale, and other per-conversion options work the same way as for Vega-Lite. See {doc}`image-quality`, {doc}`locales`, and {doc}`../advanced/conversion-overrides`.