Right so theoretically, a startup mod setting and a condition in your data.lua.
In settings.lua (In the same folder as data.lua) put this:
data:extend({
{
type = "bool-setting",
name = "yapr-high-res",
setting_type = "startup",
default_value = true,
order = "a-a"
}
})
And in data.lua you'll want this at the top:
local use_4k = settings.startup["yapr-high-res"].value
And this where you update each image:
if use_4k then
prototype.starmap_icon = "__YAPR__/graphics/"..name.."_1k.png"
prototype.starmap_icon_size = 4096
else
prototype.starmap_icon = "__YAPR__/graphics/"..name.."_4k.png"
prototype.starmap_icon_size = 1024
end
Assuming you have images ready named nauvis_1k and nauvis_4k for example, and the sizes are correct. They'll both be in the mod, but pretty sure just one will get loaded at runtime so it should save on performance.
Let me know if you run into issues.
Unrelated, but I saw your mod recommends no planet rotation. You can actually make your mod set this setting's default via a settings-updates.lua if you'd like, and even hide the setting afterwards. See here: https://wiki.factorio.com/Tutorial:Mod_settings#:~:text=Changing%20another%20mod%27s%20settings,-After