Reputation: 361
Images are represented as matrices. Is there a practical way to make sort of frame around the content of the image? (in a monoton color)
Upvotes: 2
Views: 121
Reputation: 2707
using Images, TestImages, Colors
img = testimage("mandrill")
padarray(img, Fill(colorant"magenta", (40, 40), (40, 40)))
I don't understand your comment - but you might be asking how you can use this padded image as a normal image? One way is parent
.
img_with_pretty_frame =
padarray(img, Fill(colorant"magenta", (40, 40), (40, 40)))
w, h = size(img_with_pretty_frame)
img2 = parent(img_with_pretty_frame)
img2[w ÷ 2 - 100:w ÷ 2 + 100, h÷2 - 200:h÷2 + 200] .= colorant"blue"
img2
Upvotes: 1