Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Flatten

livebooks/vix/flatten.livemd

Flatten

Mix.install([
  {:image, "~> 0.54"},
  {:req, "~> 0.5"},
  {:kino, "~> 0.14"}
])

画像の読込

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

背景の塗りつぶし

Image.flatten!(original_img)
Image.flatten!(original_img, background_color: :blue)