java.lang.Object
ij.io.FileSaver
Saves images in tiff, gif, jpeg, raw, zip and text format.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a string containing information about the specified image.static intReturns the current JPEG quality setting (0-100).static byte[][]getOverlay(ImagePlus imp) static booleanstatic booleanstatic booleanAlways returns true.booleansave()Resaves the image.booleanSave the image in BMP format using a save file dialog.booleanSave the image in BMP format using the specified path.booleanSave the image in FITS format using a save file dialog.booleansaveAsFits(String path) Save the image in FITS format using the specified path.booleanSave the image in GIF format using a save file dialog.booleanSave the image in Gif format using the specified path.booleanSave the image in JPEG format using a save file dialog.booleansaveAsJpeg(String path) Save the image in JPEG format using the specified path.booleanSave the current LUT using a save file dialog.booleanSave the current LUT using the specified path.booleanSaves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using a save file dialog.booleanSaves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using the specified path.booleanSave the image in PNG format using a save file dialog.booleanSave the image in PNG format using the specified path.booleanSave the image or stack as raw data using a save file dialog.booleanSave the image as raw data using the specified path.booleansaveAsRawStack(String path) Save the stack as raw data using the specified path.booleanSave the image as tab-delimited text using a save file dialog.booleansaveAsText(String path) Save the image as tab-delimited text using the specified path.booleanSaves the image or stack in TIFF format using a save file dialog.booleansaveAsTiff(String path) Saves the image in TIFF format using the specified path.booleansaveAsTiffStack(String path) Saves the stack as a multi-image TIFF using the specified path.booleanUses a save file dialog to save the image or stack as a TIFF in a ZIP archive.booleanSave the image or stack in TIFF/ZIP format using the specified path.voidsaveDisplayRangesAndLuts(ImagePlus imp, FileInfo fi) byte[]Converts this image to a TIFF encoded array of bytes, which can be decoded using Opener.deserialize().static voidsetBufferSize(int bufferSize) Sets the BufferedOutputStream buffer size in bytes (default is 32K).static voidsetJpegQuality(int quality) Specifies the image quality (0-100).voidupdateImagePlus(String path, int fileFormat)
-
Field Details
-
DEFAULT_JPEG_QUALITY
public static final int DEFAULT_JPEG_QUALITY- See Also:
-
-
Constructor Details
-
FileSaver
Constructs a FileSaver from an ImagePlus.
-
-
Method Details
-
save
public boolean save()Resaves the image. Calls saveAsTiff() if this is a new image, not a TIFF, or if the image was loaded using a URL. Returns false if saveAsTiff() is called and the user selects cancel in the file save dialog box. -
saveAsTiff
public boolean saveAsTiff()Saves the image or stack in TIFF format using a save file dialog. Returns false if the user selects cancel. Equivalent to IJ.saveAsTiff(imp,""), which is more convenient. -
saveAsTiff
Saves the image in TIFF format using the specified path. Equivalent to IJ.saveAsTiff(imp,path), which is more convenient. -
getOverlay
-
saveAsTiffStack
Saves the stack as a multi-image TIFF using the specified path. Equivalent to IJ.saveAsTiff(imp,path), which is more convenient. -
serialize
public byte[] serialize()Converts this image to a TIFF encoded array of bytes, which can be decoded using Opener.deserialize(). -
saveDisplayRangesAndLuts
-
saveAsZip
public boolean saveAsZip()Uses a save file dialog to save the image or stack as a TIFF in a ZIP archive. Returns false if the user selects cancel. -
saveAsZip
Save the image or stack in TIFF/ZIP format using the specified path. -
okForGif
-
saveAsGif
public boolean saveAsGif()Save the image in GIF format using a save file dialog. Returns false if the user selects cancel or the image is not 8-bits. -
saveAsGif
Save the image in Gif format using the specified path. Returns false if the image is not 8-bits or there is an I/O error. -
okForJpeg
Always returns true. -
saveAsJpeg
public boolean saveAsJpeg()Save the image in JPEG format using a save file dialog. Returns false if the user selects cancel.- See Also:
-
saveAsJpeg
Save the image in JPEG format using the specified path.- See Also:
-
saveAsBmp
public boolean saveAsBmp()Save the image in BMP format using a save file dialog. Returns false if the user selects cancel. -
saveAsBmp
Save the image in BMP format using the specified path. -
saveAsPgm
public boolean saveAsPgm()Saves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using a save file dialog. Returns false if the user selects cancel. -
saveAsPgm
Saves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using the specified path. -
saveAsPng
public boolean saveAsPng()Save the image in PNG format using a save file dialog. Returns false if the user selects cancel. -
saveAsPng
Save the image in PNG format using the specified path. -
saveAsFits
public boolean saveAsFits()Save the image in FITS format using a save file dialog. Returns false if the user selects cancel. -
saveAsFits
Save the image in FITS format using the specified path. -
okForFits
-
saveAsRaw
public boolean saveAsRaw()Save the image or stack as raw data using a save file dialog. Returns false if the user selects cancel. -
saveAsRaw
Save the image as raw data using the specified path. -
saveAsRawStack
Save the stack as raw data using the specified path. -
saveAsText
public boolean saveAsText()Save the image as tab-delimited text using a save file dialog. Returns false if the user selects cancel. -
saveAsText
Save the image as tab-delimited text using the specified path. -
saveAsLut
public boolean saveAsLut()Save the current LUT using a save file dialog. Returns false if the user selects cancel. -
saveAsLut
Save the current LUT using the specified path. -
updateImagePlus
-
getDescriptionString
Returns a string containing information about the specified image. -
setJpegQuality
public static void setJpegQuality(int quality) Specifies the image quality (0-100). 0 is poorest image quality, highest compression, and 100 is best image quality, lowest compression. -
getJpegQuality
public static int getJpegQuality()Returns the current JPEG quality setting (0-100). -
setBufferSize
public static void setBufferSize(int bufferSize) Sets the BufferedOutputStream buffer size in bytes (default is 32K).
-