how to simplyfy them

how to simplyfy them with loop

    convert2png(txt1,"img1")
    convert2png(txt2,"img2")
    convert2png(txt3,"img3")
    convert2png(txt4,"img4")

how to sprite each img one by one with tap

    sprite(imgs.img1,WIDTH/2,HEIGHT/4*3)
    sprite(imgs.img2,WIDTH/2,HEIGHT/4*3)
    sprite(imgs.img3,WIDTH/2,HEIGHT/4*3)
    sprite(imgs.img4,WIDTH/2,HEIGHT/4*3)

I would put both text and images into tables, then

for i=1,#txt do
    convert2png(txt[i], i)
end

...
for i=1,#imgs do
    sprite(imgs[i], WIDTH*0.5, HEIGHT*0.75)
end

You’d have to change convert2png to accept a number as the input for the target.

appreciate, i know it