Created
January 3, 2025 17:58
-
-
Save CnrLwlss/5a142c351522b225b601840102458b4e to your computer and use it in GitHub Desktop.
Sample some pixels from a colour image and write to file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using VideoIO | |
using Images | |
download("https://live.staticflickr.com/4293/35896494470_6e106950d9_o_d.jpg","input.jpg") | |
img = load("input.jpg") | |
(h,w) = size(img) | |
function getframe(img, dx, dy, N, scaleup) | |
smimg = img[dy:(dy+(N-1)),dx:(dx+(N-1))] | |
bigpix = repeat(smimg, inner=(scaleup,scaleup)) | |
return bigpix | |
end | |
save("singleframe.png",getframe(img,1,1873,8,200)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment