persist_image(3)
β¨ persist_image β¨
okay bestie, this one is from the Arcan Lua API and it's called persist_image β yes, that's persist_image(3), the man page you're literally reading right now π
πΈ NAME πΈ
persist_image β flags your video object as video context persistant π
π¦ SYNOPSIS π¦
bool
persist_image( vid )
π DESCRIPTION π
so likeβ¦ some objects β especially the ones linked to frameservers β lowkey need to survive otherwise aggressive operations like push_video_context. and this function? it's the glow-up. it attempts to promote the referenced object to that persistant state. main character energy only π
but here's the thing, and ngl this is important: this ability comes with several restrictions, okay? in practice, objects that are:
- linked,
- have a frameset, or
- in other ways maintain horizontal references (within the same context)
β¦are prohibited from being flagged as persistant. no cap. it's giving "you can't sit with us" π
π EXAMPLE π
here she is, living her best life and passing the vibe check:
function persist_image0()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b});
assert(persist_image(a) == true);
push_video_context();
end
see how a got flagged before push_video_context()? and the assert(...) == true? that's the slay β¨
π MISUSE π
okay now the cautionary tales, because we do not want these in your codebase, bestie π«Ά
round one β flagging it, pushing the context, and then straight-up deleting it:
function persist_image0()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b});
persist_image(a);
push_video_context();
delete_image(a);
end
π MISUSE π
round two β flagging it and then linking it (remember those horizontal references? yeah. this):
function persist_image1()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b});
persist_image(a);
link_image(a, b);
end
π MISUSE π
round three β same crime, just linking in the other direction, because the restriction doesn't care which way you spin it π
function persist_image2()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b});
persist_image(a);
link_image(b, a);
end
π MISUSE π
round four β instancing it and then pushing the context. not the move π₯
function persist_image3()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b});
persist_image(a);
c = instance_image(a);
push_video_context();
end
π«Ά real talk: all four of these are labeled MISUSE in the original for a reason β this page is showing you the wrong ways. take notes, don't copy them into your project.
π SEE ALSO π
go read these next, iykyk:
okay that's the whole page, you ate that π
this was image, October 2026, straight out of the Arcan Lua API β mwah, go forth and persist responsibly π§π
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms