Each year there are several challenges for generative arts in the month January called “Genuary” ( https://genuary.art/prompts ). This #genuary2022 the prompt simply says “VHS” so my thoughts was to create some noise and chromatic aberrations like an old VHS tape that is damaged.
Open the image and add some artifacts:
In[]:=
SetDirectory[NotebookDirectory[]];img=Import["2022_15.jpg"];(*importoriginalphoto*)img=ImageResize[img,300];(*makeitabitsmaller*)img//=ImageAdjust[#,{0.2,0.1}]&;(*highcontrast*)cs=ImageData/@ColorSeparate[img,"RGB"];cs[[2]]//=Map[RotateLeft[#,2]&];(*movethegreenchanneltotheleft*)cs[[3]]//=Map[RotateLeft[#,-2]&];(*movethebluechanneltotheright*){width,height}=ImageDimensions[img](*Getdimensions*)ColorCombine[Image/@cs](*combinechannelsandcheck*)
Out[]=
{300,450}
Out[]=
Generate some random shifts for each time, height, and channel. Smooth them so they are spatially correlated.
SeedRandom[12345];n=150;rndm=shifts=RandomVariate[NormalDistribution[0,25],{n,Length[cs],height}];corr=25;rndm=Map[MovingAverage[Join[#,Take[#,corr-1]],corr]&,rndm,{2}];shifts*=0.0;(*takesomechunkoftheseshiftsandcopythemintothenew"shifts"array*)Do[dims=Dimensions[shifts];h=RandomInteger[{15,100}];τ=RandomInteger[{1,7}];ti=RandomInteger[{1,dims[[1]]-τ}];ti=Span@@{ti,ti+τ};ci=RandomInteger[{1,dims[[2]]}];hi=RandomInteger[{1,dims[[3]]-h}];hi=Span@@{hi,hi+h};shifts[[ti,ci,hi]]=rndm[[ti,ci,hi]];,{60}]ClearAll[MakeScene]MakeScene[tn_Integer]:=Module[{data,img},(*retrieveeachchannel,line,shift,shiftitandsoon,andcombineagaintoanimage.*)data=Table[c=cs[[ci]];Table[RotateLeft[c[[hi]],Round@shifts[[tn,ci,hi]]],{hi,Length[c]}],{ci,Length[cs]}];data+=RandomReal[{-1,1}0.03,Dimensions[data]];(*addrandomnoise*)data//=Clip[#,{0,1}]&;(*clipit*)img=ColorCombine[Image/@data];ImportString[ExportString[img,"JPEG",CompressionLevel->0.75]](*addextranoisefromJPEGcompression*)]imgs=MakeScene/@Range[n];(*createframes*)
Export the frames (at 24 fps like PAL):
In[]:=
SetDirectory[NotebookDirectory[]];Export["2022_15.gif",imgs,"DisplayDurations"->1/24]
Out[]=
2022_15.gif