This is a bug and I don't know how to continue because of it current version 1.5.0

Ok first the code


-- signiture

-- Use this function to perform your initial setup
function setup()
    print("Hello World!")
end
x=0
y=0
-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(0, 0, 0, 255)

    -- This sets the line thickness
    

    -- Do your drawing here
    img = image(16, 16)
img:set(1,16,254,254,254,1)
img:set(2,5,177,177,177,78)
img:set(2,6,159,159,159,96)
img:set(2,7,145,145,145,110)
img:set(2,8,143,143,143,112)
img:set(2,9,145,145,145,110)
img:set(2,10,159,159,159,96)
img:set(2,11,177,177,177,78)
img:set(3,4,175,175,175,80)
img:set(3,5,153,153,153,102)
img:set(3,6,0,0,0,255)
img:set(3,7,0,0,0,255)
img:set(3,8,0,0,0,255)
img:set(3,9,0,0,0,255)
img:set(3,10,0,0,0,255)
img:set(3,11,153,153,153,102)
img:set(3,12,175,175,175,80)
img:set(4,3,175,175,175,80)
img:set(4,4,154,154,154,101)
img:set(4,5,0,0,0,255)
img:set(4,8,0,0,0,255)
img:set(4,11,0,0,0,255)
img:set(4,12,154,154,154,101)
img:set(4,13,175,175,175,80)
img:set(5,2,177,177,177,78)
img:set(5,3,153,153,153,102)
img:set(5,4,0,0,0,255)
img:set(5,7,0,0,0,255)
img:set(5,8,0,0,0,255)
img:set(5,9,0,0,0,255)
img:set(5,12,0,0,0,255)
img:set(5,13,153,153,153,102)
img:set(5,14,178,178,178,77)
img:set(6,2,159,159,159,96)
img:set(6,3,0,0,0,255)
img:set(6,8,0,0,0,255)
img:set(6,13,0,0,0,255)
img:set(6,14,159,159,159,96)
img:set(7,2,145,145,145,110)
img:set(7,3,0,0,0,255)
img:set(7,5,0,0,0,255)
img:set(7,11,0,0,0,255)
img:set(7,13,0,0,0,255)
img:set(7,14,146,146,146,109)
img:set(8,2,143,143,143,112)
img:set(8,3,0,0,0,255)
img:set(8,4,0,0,0,255)
img:set(8,5,0,0,0,255)
img:set(8,6,0,0,0,255)
img:set(8,8,255,0,0,255)
img:set(8,10,0,0,0,255)
img:set(8,11,0,0,0,255)
img:set(8,12,0,0,0,255)
img:set(8,13,0,0,0,255)
img:set(8,14,144,144,144,111)
img:set(9,2,145,145,145,110)
img:set(9,3,0,0,0,255)
img:set(9,5,0,0,0,255)
img:set(9,11,0,0,0,255)
img:set(9,13,0,0,0,255)
img:set(9,14,146,146,146,109)
img:set(10,2,159,159,159,96)
img:set(10,3,0,0,0,255)
img:set(10,8,0,0,0,255)
img:set(10,13,0,0,0,255)
img:set(10,14,159,159,159,96)
img:set(11,2,177,177,177,78)
img:set(11,3,153,153,153,102)
img:set(11,4,0,0,0,255)
img:set(11,7,0,0,0,255)
img:set(11,8,0,0,0,255)
img:set(11,9,0,0,0,255)
img:set(11,12,0,0,0,255)
img:set(11,13,153,153,153,102)
img:set(11,14,178,178,178,77)
img:set(12,3,175,175,175,80)
img:set(12,4,154,154,154,101)
img:set(12,5,0,0,0,255)
img:set(12,8,0,0,0,255)
img:set(12,11,0,0,0,255)
img:set(12,12,154,154,154,101)
img:set(12,13,175,175,175,80)
img:set(13,4,175,175,175,80)
img:set(13,5,153,153,153,102)
img:set(13,6,0,0,0,255)
img:set(13,7,0,0,0,255)
img:set(13,8,0,0,0,255)
img:set(13,9,0,0,0,255)
img:set(13,10,0,0,0,255)
img:set(13,11,153,153,153,102)
img:set(13,12,175,175,175,80)
img:set(14,5,159,159,159,96)
img:set(14,6,159,159,159,96)
img:set(14,7,146,146,146,109)
img:set(14,8,144,144,144,111)
img:set(14,9,146,146,146,109)
img:set(14,10,159,159,159,96)
img:set(14,11,178,178,178,77)
smooth()
sprite(CAMERA,WIDTH/2,HEIGHT/2)
scope=sprite(img,x,y,WIDTH/5,HEIGHT/5)
tween(1, scope, {x = WIDTH/2, y = HEIGHT/2})
return img


end



Error message is

error: [string "-------------------------------------------..."]:92: subject must be a table or userdata. Was nil

Look at the 92 in the code it’s just a set pixel
Is it internal code?

It’s not the pixel setting causing an issue. You have everything shoved into draw where it’s being redefined several times a second.

Try something more like this:



function setup()
    displayMode(FULLSCREEN)
    img = image(16, 16)
    img:set(1,16,254,254,254,1)
    img:set(2,5,177,177,177,78)
    img:set(2,6,159,159,159,96)
    img:set(2,7,145,145,145,110)
    img:set(2,8,143,143,143,112)
    img:set(2,9,145,145,145,110)
    img:set(2,10,159,159,159,96)
    img:set(2,11,177,177,177,78)
    img:set(3,4,175,175,175,80)
    img:set(3,5,153,153,153,102)
    img:set(3,6,0,0,0,255)
    img:set(3,7,0,0,0,255)
    img:set(3,8,0,0,0,255)
    img:set(3,9,0,0,0,255)
    img:set(3,10,0,0,0,255)
    img:set(3,11,153,153,153,102)
    img:set(3,12,175,175,175,80)
    img:set(4,3,175,175,175,80)
    img:set(4,4,154,154,154,101)
    img:set(4,5,0,0,0,255)
    img:set(4,8,0,0,0,255)
    img:set(4,11,0,0,0,255)
    img:set(4,12,154,154,154,101)
    img:set(4,13,175,175,175,80)
    img:set(5,2,177,177,177,78)
    img:set(5,3,153,153,153,102)
    img:set(5,4,0,0,0,255)
    img:set(5,7,0,0,0,255)
    img:set(5,8,0,0,0,255)
    img:set(5,9,0,0,0,255)
    img:set(5,12,0,0,0,255)
    img:set(5,13,153,153,153,102)
    img:set(5,14,178,178,178,77)
    img:set(6,2,159,159,159,96)
    img:set(6,3,0,0,0,255)
    img:set(6,8,0,0,0,255)
    img:set(6,13,0,0,0,255)
    img:set(6,14,159,159,159,96)
    img:set(7,2,145,145,145,110)
    img:set(7,3,0,0,0,255)
    img:set(7,5,0,0,0,255)
    img:set(7,11,0,0,0,255)
    img:set(7,13,0,0,0,255)
    img:set(7,14,146,146,146,109)
    img:set(8,2,143,143,143,112)
    img:set(8,3,0,0,0,255)
    img:set(8,4,0,0,0,255)
    img:set(8,5,0,0,0,255)
    img:set(8,6,0,0,0,255)
    img:set(8,8,255,0,0,255)
    img:set(8,10,0,0,0,255)
    img:set(8,11,0,0,0,255)
    img:set(8,12,0,0,0,255)
    img:set(8,13,0,0,0,255)
    img:set(8,14,144,144,144,111)
    img:set(9,2,145,145,145,110)
    img:set(9,3,0,0,0,255)
    img:set(9,5,0,0,0,255)
    img:set(9,11,0,0,0,255)
    img:set(9,13,0,0,0,255)
    img:set(9,14,146,146,146,109)
    img:set(10,2,159,159,159,96)
    img:set(10,3,0,0,0,255)
    img:set(10,8,0,0,0,255)
    img:set(10,13,0,0,0,255)
    img:set(10,14,159,159,159,96)
    img:set(11,2,177,177,177,78)
    img:set(11,3,153,153,153,102)
    img:set(11,4,0,0,0,255)
    img:set(11,7,0,0,0,255)
    img:set(11,8,0,0,0,255)
    img:set(11,9,0,0,0,255)
    img:set(11,12,0,0,0,255)
    img:set(11,13,153,153,153,102)
    img:set(11,14,178,178,178,77)
    img:set(12,3,175,175,175,80)
    img:set(12,4,154,154,154,101)
    img:set(12,5,0,0,0,255)
    img:set(12,8,0,0,0,255)
    img:set(12,11,0,0,0,255)
    img:set(12,12,154,154,154,101)
    img:set(12,13,175,175,175,80)
    img:set(13,4,175,175,175,80)
    img:set(13,5,153,153,153,102)
    img:set(13,6,0,0,0,255)
    img:set(13,7,0,0,0,255)
    img:set(13,8,0,0,0,255)
    img:set(13,9,0,0,0,255)
    img:set(13,10,0,0,0,255)
    img:set(13,11,153,153,153,102)
    img:set(13,12,175,175,175,80)
    img:set(14,5,159,159,159,96)
    img:set(14,6,159,159,159,96)
    img:set(14,7,146,146,146,109)
    img:set(14,8,144,144,144,111)
    img:set(14,9,146,146,146,109)
    img:set(14,10,159,159,159,96)
    img:set(14,11,178,178,178,77)
    startPos = {x=0, y=0}
    smooth()
end

function draw()
    background(0, 0, 0, 255)
    x=0
    y=0

    sprite(CAMERA,WIDTH/2,HEIGHT/2)
    sprite(img, startPos.x, startPos.y, 111)
    tween(5, startPos, {x=WIDTH/2,y=HEIGHT/2})

end

Put the tween in setup or else it gets glitchy.