Unable to view fit output from imagemagick in Siril

Hello,

When using imagemagick for colour changes, if the output is in fit format Siril opens it as a black file. It opens okay in ASTAP.

If I use tif for working in IM, all is well. Or, if I open the IM tif file in SIRIL, then save as fit from within Siril, again all is well.

Do I need to change any option in either Siril or IM? Or is is this a known incompatibility?

Please, share the FITS file.

I don’t know the answer, but you might ask the question on an ImageMagick forum: Discussions · ImageMagick/ImageMagick · GitHub

If IM is generating fits files that do not conform to standards, the developers are likely to fix the problem. But it might be that IM is writing a fits feature that Siril doesn’t understand.

Check that your version of IM is fairly recent, eg 7.1.0-something.

If you do post on an IM forum, please state the version of IM, and the platform (eg Windows 10 or some version of Unix or whatever), and the command you used, with any required input files. The developers need to be able to reproduce the problem.

I have sent it on PM, along with details of process and screenshot of file open in AF

Thanks, will do that once lock042 confirms its a software issue and not some setting or option I have overlooked.

Wow. I took a look to the header.

SIMPLE  =                    T
BITPIX  =                   32
NAXIS   =                    2
NAXIS1  =                 2938
NAXIS2  =                 2938
BSCALE  =         1.000000E+00
BZERO   =         2.147484E+09
DATAMAX =         4.294967E+09
DATAMIN =         0.000000E+00
HISTORY https://imagemagick.org

This is the shorter FITS header I ever seen. I’m pretty sure that Siril tries to open it as a 32bits file in the [0, 1] range.
I think I never seen this kind of ulong file. I will fix that but try to save your file in 32bit floating point. it is better.

Will be fixed in next release:

… but try to save your file in 32bit floating point. it is better.

Experimenting with IM v7.1.0-4, it seems we can save a fits file as integer, or 32-bit floating point, or 64-bit floating point, like this:

magick toes.png out1.fits

magick toes.png -define quantum:format=floating-point -depth 32 out2.fits

magick toes.png -define quantum:format=floating-point -depth 64 out3.fits

File sizes in bytes are:

11/08/2021  18:54           377,280 out1.fits
11/08/2021  18:54           751,680 out2.fits
11/08/2021  18:53         1,497,600 out3.fits

“exiftool out3.fits” says:

ExifTool Version Number         : 12.13
File Name                       : out3.fits
Directory                       : .
File Size                       : 1462 KiB
File Modification Date/Time     : 2021:08:11 18:53:51+01:00
File Access Date/Time           : 2021:08:11 18:53:51+01:00
File Creation Date/Time         : 2021:08:11 18:53:51+01:00
File Permissions                : rw-rw-rw-
File Type                       : FITS
File Type Extension             : fits
MIME Type                       : image/fits
Bitpix                          : -64
Naxis                           : 3
Naxis 1                         : 267
Naxis 2                         : 233
Naxis 3                         : 3
Bscale                          : 1.000000e+00
Bzero                           : 0.000000e+00
Datamax                         : -1.000000e+00
Datamin                         : 0.000000e+00

I don’t use Siril, and can’t comment on whether Siril can read these files.

Your file has a double precision.
Then data_max has -1.0000 and it is strange.

Yes, that “Datamax -1” is weird.

For integer out1.fits we have:

Bscale                          : 1.000000e+00
Bzero                           : 3.276800e+04
Datamax                         : 6.553500e+04
Datamin                         : 0.000000e+00

For 32-bit out2.fits we have:

Bscale                          : 1.000000e+00
Bzero                           : 2.147484e+09
Datamax                         : 4.294967e+09
Datamin                         : 0.000000e+00

I have put a zip of the three fits files at http://snibgo.com/imforums/fits.zip

Sorry, I cannot download your files.

Sorry, I cannot download your files.

Do you get an error message?

It works fine for me, and there is no weird security on the file or directory.

Perhaps it is a temporary internet problem.

OK, I did it with Firefox.
The second FITS has some issues;

But I cannot open it with other software, like ASTAP.

Sorry, I know nothing about the fits file format.

Thanks. Will look forward to the release.

I had tried with the -define quantum:format=floating-point -depth 32 options.

The file is opened by SIRIL but it is only black and white, Affinity and irfanview show white screen. ASTAP does not open at all. Only GIMP opens it properly.

So that seems to be an imagemagick issue.