How to convert a raster dataset to a JPEG2000 raster dataset

This article shows how to convert a raster dataset to a JPEG2000 file with a specified quality.

Converting a raster dataset to a JPEG2000 raster dataset

The following code example can also be applied to save to a Joint Photographic Experts Group (JPEG) and other writable raster formats with a little modification of the compression type and format string:
static void convertToJPEG2000(IRasterDataset rasterDataset, IWorkspace
    outputWorkspace)throws Exception{
    //Set storage parameter for compression and quality
    IRasterStorageDef rasterStorage = new RasterStorageDef();

    //Save out to a JP2 file in the output workspace
    ISaveAs2 saveAs = new ISaveAs2Proxy(rasterDataset);
    saveAs.saveAsRasterDataset("output1.jp2", outputWorkspace, "JP2", rasterStorage);

See Also:

How to access a raster dataset or raster catalog

Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine