I need to convert a fits file to jpg in java. I've tried with imageJ but I need a simple library without GUI. I'm developing a web page in java and I need to convert the file in background (headlessly).
Asked
Active
Viewed 139 times
1 Answers
1
Alex solved it by doing this:
public void fitsToJpg(String source, String destination, String image){
try {
ImagePlus imageP = openImage(source+image);
final File out = new File(destination+"preview.jpg");
BufferedImage imagen = imageP.getBufferedImage();
ImageIO.write(imagen, "jpg", out);
} catch (IOException ex) {
Logger.getLogger(Fits.class.getName()).log(Level.SEVERE, null, ex);
}
}