update doc

This commit is contained in:
ton
2023-04-16 11:20:30 +07:00
parent 0c2b34d6f8
commit 4e49cdfd0f

View File

@@ -126,6 +126,12 @@ end
Padding options:
:buttomRight will place an image at top-left of a frame(dimension x dimension) and fill
the rest of the frame with RGB(0,0,0)
#Example
using FileIO, Images
img = load("test.jpg")
img = eltype(img) != RGB{N0f8} ? RGB.(img) : img # ensure img is in RGB format
rescaled_padded_img = imgScalePadding(img, 1024, paddingType=:buttomRight)
"""
function imgScalePadding(img::T, dimension::Integer; paddingType::Symbol=:none) where T <:DenseMatrix{RGB{N0f8}}
h, w = size(img) # high = vertical length, width = horizonal length