Now I see the problem. I misunderstood
loadimageresized() and ended up with a 16384x5184 pixel sprite ...
With that fixed, my framerate is now about 80. Still not super fast, though.
Checking an empty test game, I got a framerate of about 800
I display a monitor-sized sprite with transparence, and a pixelart sprite upscaled to monitor size. Maybe it just take that many resources?
by not rendering the upscaled pixelart and not rendering the hd texture I can get a framerate of 230. The rendering still looks like the bottleneck, though.