Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Getting Max image size?

in Questions Posts: 181

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.

Comments

  • dave1707dave1707 Mod
    Posts: 7,673

    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.

  • dave1707dave1707 Mod
    edited February 2018 Posts: 7,673

    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.

  • Posts: 181

    Thanks @dave1707 , I suppose there isn’t a way to detect the device type either?

  • dave1707dave1707 Mod
    edited February 2018 Posts: 7,673

    @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.

    https://support.hockeyapp.net/kb/client-integration-ios-mac-os-x-tvos/ios-device-types
    
  • Posts: 181

    That’s awesome! Thanks @dave1707 !

  • edited July 23 Posts: 395

    @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.

  • dave1707dave1707 Mod
    Posts: 7,673

    @piinthesky I get the same results on my iPad Pro.

  • SimeonSimeon Admin Mod
    Posts: 5,004

    @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

Sign In or Register to comment.