-1

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

Veve
  • 6,182
  • 5
  • 37
  • 53
Alex
  • 11
  • 1

1 Answers1

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);
    }
}
Community
  • 1
  • 1
Veve
  • 6,182
  • 5
  • 37
  • 53