https://sergiotapia.me/generate-images-with-name-initials-using-elixir-and-imagemagick-374eca4d14ff
Hope this saves you guys some time! Using ImageMagick and some fancy flags is all you need to generate nice initial avatars for your users.
https://sergiotapia.me/generate-images-with-name-initials-using-elixir-and-imagemagick-374eca4d14ff
Hope this saves you guys some time! Using ImageMagick and some fancy flags is all you need to generate nice initial avatars for your users.
Unfortunately this link is dead…
Does anyone have another recommended link for this purpose?
maybe http://tapia49.rssing.com/chan-5508682/all_p2.html#item35
(near the bottom of the page) -> 02/21/18–08:04: Generate images with name initials using Elixir and ImageMagick.
Thank you random chinese bot scraper website! I lost my old blog and now I can recover this post!
I made a new package that uses your PNG generation code:
That’s amazing bro!
Thanks for the motivation to fix a couple of bugs in Image. As of version 0.26.0 its easier to generate text-based avatars and to produce either square or circular avatars.
There’s no specific support for text-based background color generation but that might be interesting to add to the Image.Color
module.
iex> Image.avatar!("./test/support/images/Kip_small.jpg", shape: :square)
iex> Image.avatar!("./test/support/images/Kip_small.jpg", shape: :circle)
iex> Image.Text.text!("KC", background_fill_color: :cyan, font_size: 200, padding: 80)
...> |> Image.avatar!(shape: :square)
iex> Image.Text.text!("KC", background_fill_color: :cyan, font_size: 200, padding: 80)
...> |> Image.avatar!(shape: :circle)
Since Image
is based on vix and libvips the code is fast and memory efficient. Definitely faster than using ImageMagick since vix
is NIF based. And generally considered more secure that ImageMagick too.