Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 345 Bytes

svg_to_png.livemd

File metadata and controls

26 lines (21 loc) · 345 Bytes

SVG to PNG

Mix.install([
  {:image, "~> 0.24"},
  {:req, "~> 0.3"},
  {:kino, "~> 0.8"}
])

Download SVG

svg_img =
  "https://www.elixirconf.eu/assets/images/drops.svg"
  |> Req.get!()
  |> Map.get(:body)
  |> Image.from_binary()
  |> elem(1)

Save as PNG

Image.write(svg_img, "png_img.png")