View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

convert .fit to .jpg

Andrew Staunton wrote on Sep 17, 2011

hello

What is the easiest way to convert a .fit image to .jpg?

And an extension to this question is, can I easily create a .jpg that shows both the .fit image I want and also overlain on that, say a BPM.
To clarify, I can display a .fit image in DS9 and if I have the parameters correct, the task "disp" will overlay the BPM (or whatever mask) - is it easy to create a .jpg of not only the .fit image but also includes the mask overlay?

Mike Fitzpatrick wrote on Sep 17, 2011

Easy is, of course, relative. IRAF doesn't support JPEG files directly however the EXPORT task in DATAIO can convert images to a number of other formats and provides functions for scaling, colormaps, combining images, etc (See the help page examples). If you need one of these functions to produce a good image then I'd suggest using this task to create a GIF and then some host tool (ImageMagick or XV) to convert to a JPEG. ImageMagick does support FITS files directly but does a simple linear scaling of the data (as opposed to the 'zscale' you might see from the DISPLAY task).

For creating an overlay image, I'd suggest using the DISPLAY task and whatever does the overlay, then use TVMARK to readback the image from the display to create a new image. EXPORT is able to preserve the overlay colors, note that what you get in the readback image are 8-bit display values. Hope this helps.

Last post on Sep 17, 2011