using Aspose.Imaging;
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
string templatesFolder = @"c:\Users\USER\Downloads\templates\";

// Load the gif file in an instance of Image
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.gif")))
{
   // Create an instance of Jpeg2000Options
   var exportOptions = new Aspose.Imaging.ImageOptions.Jpeg2000Options(){ Codec = Aspose.Imaging.FileFormats.Jpeg2000.Jpeg2000Codec.J2K };

   // Save gif to j2k
   image.Save(Path.Combine(templatesFolder, "output.j2k"), exportOptions);

   File.Delete(Path.Combine(templatesFolder, "output.j2k"));
}