Skip to content

Instantly share code, notes, and snippets.

View CnrLwlss's full-sized avatar

Conor Lawless CnrLwlss

View GitHub Profile
@CnrLwlss
CnrLwlss / single_colour_frame.jl
Created January 3, 2025 17:58
Sample some pixels from a colour image and write to file
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))
@CnrLwlss
CnrLwlss / colour_samples.jl
Created January 3, 2025 18:10
Iterative construction of video from contiguous samples from static image
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))