Is there a way to find out what the max image size is? I understand it’s to do with the hardware, so it would be great to be able to get the max image size in setup.
I don’t think there’s a command to get the max size and what I remember is Codea allows a max image size of 2048 by 2048. You can try larger sizes to see if that changed.
I tried larger image sizes on my iPad Pro and was able to create an 8192 by 8192 image and draw an ellipse in the corners. An 8193 by 8193 image didn’t work at all. On my iPad Air, the max was 4096.
On my iPad 1, the max is 2048.
Thanks @dave1707 , I suppose there isn’t a way to detect the device type either?
@Kirl Try this for device type.
function setup() t=deviceMetrics() for a,b in pairs(t) do print(a,b) end end
See this link for device info.
That’s awesome! Thanks @dave1707 !
@dave1707, i wanted to save an image at maximum resolution… I was able to sprite to the screen a 8192 by 8192 image on my ipad pro 12 inch, but when i use saveImage to save the image it causes Codea to crash. SaveImage seems okay at 6000 by 6000. @Simeon is there a limit to the maximum saveImage image size?
P.s. @Simeon is the screen copy image still saved in .jpeg? it would be better in .png so the alpha is preserved.
@piinthesky I get the same results on my iPad Pro.
@piinthesky I have a feeling your 6k x 6k image is really 12,000x12,000 pixels in retina resolution and you are simply running out of memory trying to save it.
That’s around 550 MB and it may need to make more than one copy temporarily so would use gigabytes of memory to save