Welcome to image Discussions! #1
kipcole9
announced in
Announcements
Replies: 5 comments 9 replies
|
The current implementation of It would be better to do the following lib/kino.ex def show(%Vimage{} = image, opts \\ []) do
image = maybe_resize_image(image, opts)
{:ok, image_bin} = Vimage.write_to_buffer(image, ".png")
apply(Kino.Image, :new, [image_bin, "image/png"])
end |
1 reply
|
Why not add thickness to the Image.Draw.rect parameter as follows draw_rect = fn img, left, top, width, height, thickness ->
img
|> Image.Draw.rect!(left, top, thickness, height, color: :blue, fill: true)
|> Image.Draw.rect!(left, top, width, thickness, color: :blue, fill: true)
|> Image.Draw.rect!(left + width - thickness, top, thickness, height, color: :blue, fill: true)
|> Image.Draw.rect!(left, top + height - thickness, width, thickness, color: :blue, fill: true)
end |
0 replies
|
That's a very creative solution. I'm reluctant to add it to |
4 replies
|
How about a function to add the alpha band add_alpha = fn rgb_img ->
alpha_band = Image.new!(rgb_img, bands: 1, color: Image.Color.max_opacity())
Vix.Vips.Operation.bandjoin!([rgb_img, alpha_band])
end |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




Uh oh!
There was an error while loading. Please reload this page.
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
All reactions