(.fits) Flexible Image Transport System (FITS) is an open standard defining a digital file format useful for storage, transmission and processing of scientific and other images. FITS is the most commonly used digital file format in astronomy.
Asked
Active
Viewed 223 times
-2
-
1[A quick google for Java Fits](https://www.google.com.au/search?client=safari&rls=en&q=java+fits&ie=UTF-8&oe=UTF-8&gfe_rd=cr&dcr=0&ei=ixdQWumYDcPN8gfo7JmIAg) brings up some interesting possible solutions - what you're looking for is any library which can return a `java.awt.Image` or equivalent - You might find that you need to convert the titles of the FITS image into a `BufferedImage` yourself – MadProgrammer Jan 06 '18 at 00:27
3 Answers
1
From the description of the javax.imageio
package.
All implementations of
javax.imageio
provide the following standard image format plug-ins:
- JPEG
- PNG
- BMP
- WBMP
- GIF
Although FITS is not included, Java imaging uses a Service Provider Interface to allow adding support for other image formats. To do that, find or write a class that can understand the CODEC, then make it available to the Java imaging API via the SPI.
See Also

Andrew Thompson
- 168,117
- 40
- 217
- 433
0
You can find a good library and documentation here: https://fits.gsfc.nasa.gov/ here you can find java specific libraries: https://fits.gsfc.nasa.gov/fits_libraries.html

navy1978
- 1,411
- 1
- 15
- 35
0
From list of libraries for handling FITS you can choose for example eat.fits.
Then you can get:
RandomAccessFile file = new RandomAccessFile(path, "r");
RandomAccessFitsFile fitFile = new RandomAccessFitsFile(file);
FitsHDU hdu = fitFile.getHDU(0); //here may be other layer. but for image is standard first
FitsImageData imgData = (FitsImageData) hdu.getData();
FitsImageViewer image = new FitsImageViewer(imgData );
Where FitsImageViewer extends JPanel, so you can add it to JFrame and display yout FITS image.

Miloš Uriga
- 65
- 7