Welcome to image Discussions! #1
Replies: 5 comments 9 replies
-
|
Wouldn't it be better if the Image tab was displayed by default? |
Beta Was this translation helpful? Give feedback.
-
|
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 |
Beta Was this translation helpful? Give feedback.
-
|
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 |
Beta Was this translation helpful? Give feedback.
-
|
That's a very creative solution. I'm reluctant to add it to |
Beta Was this translation helpful? Give feedback.
-
|
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 |
Beta Was this translation helpful? Give feedback.




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.
Beta Was this translation helpful? Give feedback.
All reactions