persist_image(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

✨ 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