Author Topic: Maximum image size?  (Read 3866 times)

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Maximum image size?
« on: 2013 December 15 13:10:33 »
I have a doubt: What is the maximum image size that can be used in PixInsight?

I am working in a script that can generate really big images. I can create images of 13500x13500 pixels, but it fails when writing them to a FITS file:
Code: [Select]
Writing file:
C:/Users/Andres/Desktop/tmp/2013-06-15 M101 v2_registered.fit
Writing FITS image: 32-bit floating point, 3 channel(s), 13500x13500 pixels:  68%
*** PCL Exception: PCL FITS Format Support: FITS file write error:
C:/Users/Andres/Desktop/tmp/2013-06-15 M101 v2_registered.fit
CFITSIO error message stack:
01 : Error reading data buffer from file:
02 : C:\Users\Andres\Desktop\tmp\2013-06-15 M101 v2_registered.fit
03 : Error writing elements 1 thru 7200 of input data array (ffpcld).
<* failed *>

Images of 13000x13000 can be written without problems. I don't know if this is a bug or an undocumented limitation. I am using PI 1.8.0.1065 in a Win7x64 computer with 24GB of memory.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Maximum image size?
« Reply #1 on: 2013 December 15 13:38:12 »
The theoretical maximum image dimensions are (231-1)x(231-1) pixels, since image coordinates are internally represented as 32-bit signed integers.

You're experiencing a 2 GB file size limit. Assuming you're working with an NTFS filesystem, this shouldn't happen on Windows. On 64-bit Linux, I've just written a 32-bit floating point image with 13500x13500 pixels to a FITS file without problems, on a laptop with 8 GB of RAM. The same on Mac OS X.

So the problem must be with CFITSIO, which is probably using old Win32 APIs for FAT32 compatibility. I'll investigate it.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Maximum image size?
« Reply #2 on: 2013 December 15 15:18:52 »
So the problem must be with CFITSIO, which is probably using old Win32 APIs for FAT32 compatibility. I'll investigate it.
Thanks Juan. Since nobody has found this problem before it seems that this is not urgent.

I am working in a script for making all-sky mosaics that can generate very big images. As a teaser, I have attached an example of an annotated image that nearly covers the whole sky.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Maximum image size?
« Reply #3 on: 2013 December 26 13:05:22 »
I can not open in PixInsight a PNG of 84628x7279 pixels with 32bits pixels:
Code: [Select]
open "file:///C:/Users/Andres/Desktop/[Group 1]-IMG_6980_IMG_7041-62 images.png"
Reading 1 file(s):
C:/Users/Andres/Desktop/[Group 1]-IMG_6980_IMG_7041-62 images.png
<* failed *>
*** Error: Unable to open file: C:/Users/Andres/Desktop/[Group 1]-IMG_6980_IMG_7041-62 images.png
** No files were loaded.
I am using Win7 x64 with 24GB of memory. The photo viewer of windows can open it without problems.
It has a file size of 902MB.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Maximum image size?
« Reply #4 on: 2014 September 08 09:22:57 »
Hi Andrés, everybody,

I have just released an update to the FITS format support module that fixes this problem on Windows. CFITSIO version 3.37 (released June 2014) is now integrated with the FITS module on all platforms. Along with many other bug fixes (see CFITSIO's homepage for more information), this version supports FITS files without specific file size limits on Windows. Note that previous versions already had no size limits on FreeBSD, Linux and Mac OS X.

Thank you for your patience with this problem staying unresolved for many months.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/