sig
  type gif_extension =
      GifComment of string list
    | GifGraphics of string list
    | GifPlaintext of string list
    | GifApplication of string list
    | GifOtherExt of int * string list
  type gif_frame = {
    frame_left : int;
    frame_top : int;
    frame_bitmap : Index8.t;
    mutable frame_extensions : Gif.gif_extension list;
    frame_delay : int;
  }
  type gif_sequence = {
    screen_width : int;
    screen_height : int;
    screen_colormap : Color.rgb Color.map;
    frames : Gif.gif_frame list;
    loops : int;
  }
  val check_header : string -> Images.header
  val load : string -> Images.load_option list -> Gif.gif_sequence
  val load_sequence : string -> Images.load_option list -> Images.sequence
  val load_first : string -> Images.load_option list -> Images.t
  val save : string -> Images.save_option list -> Gif.gif_sequence -> unit
  val save_image : string -> Images.save_option list -> Images.t -> unit
  type in_channel
  type out_channel
  type screen_info = {
    s_width : int;
    s_height : int;
    s_color_resolution : int;
    s_back_ground_color : int;
    s_colormap : Color.rgb array;
  }
  type record_type =
      Undefined
    | Screen_desc
    | Image_desc
    | Extension
    | Terminate
  type gif_desc = {
    desc_left : int;
    desc_top : int;
    desc_width : int;
    desc_height : int;
    desc_interlace : bool;
    desc_colormap : Color.rgb array;
  }
  val dGifOpenFileName : string -> Gif.screen_info * Gif.in_channel
  val dGifCloseFile : Gif.in_channel -> unit
  val dGifGetRecordType : Gif.in_channel -> Gif.record_type
  val dGifGetImageDesc : Gif.in_channel -> Gif.gif_desc
  val dGifGetLine : Gif.in_channel -> string
  val dGifGetExtension : Gif.in_channel -> int * string list
  val eGifOpenFileName : string -> Gif.out_channel
  val eGifCloseFile : Gif.out_channel -> unit
  val eGifPutScreenDesc : Gif.out_channel -> Gif.screen_info -> unit
  val eGifPutImageDesc : Gif.out_channel -> Gif.gif_desc -> unit
  val eGifPutLine : Gif.out_channel -> string -> unit
  val eGifPutExtension : Gif.out_channel -> int * string list -> unit
end