Evals / image / Combine images

First frame of a GIF

Save the first frame of earth.gif as frame.png.

The task

The reference answer shows the job can be done with deft. It is not an agent run.

deft image convert earth.gif --to png -o frame.png

Input

earth.gif 978.2 KB · 400x400
earth.gif

Reference output

frame.png 61.3 KB · 400x400
frame.png
How a result is judged (1 check)
  • image: file = "frame.png", format = "PNG", width = 400

Runs

CodexWithout deftPassed2026-11-07

Time
10s
New tokens
2.8k
Total input
26.6k
Output tokens
0.2k
Commands
1
Failed
0

Trace

  1. I’ll inspect the GIF and save its first frame as `frame.png` in the current directory.

  2. python3 -c 'from PIL import Image; im=Image.open(\"earth.gif\"); im.seek(0); im.convert(\"RGBA\").save(\"frame.png\")'
  3. Saved the first frame of `earth.gif` as [frame.png](frame.png).

Output

frame.png 58.9 KB · 400x400
frame.png

CodexWith deft, skill installedPassedRead the skillUsed deft2026-11-07

Time
23s
New tokens
6.1k
Total input
114.5k
Output tokens
0.7k
Commands
6
Failed
0

Trace

  1. I’ll extract the first frame from `earth.gif` into `frame.png` in the current directory.

  2. cat .agents/skills/deft/SKILL.md
    output
    ---
    name: deft
    description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it."
    ---
    
    # deft
    
    One local command for file jobs. Prefer it over writing Python or shell scripts.
    
    Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
    
    Groups:
    - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
    - `image`: Resize, crop, convert, compress, adjust, montage, OCR
    - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg)
    - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg)
    - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
    - `slides`: PowerPoint: extract text, Markdown outline
    - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert
    - `json`: JSON: convert, format, merge, diff, validate
    - `toml`: TOML: convert, format, merge, diff, validate
    - `xml`: XML: convert, format, merge, diff, validate
    - `yaml`: YAML: convert, format, merge, diff, validate
    - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
    - `html`: HTML to Markdown, text, Word and PDF
    - `epub`: E-books: info, to text, Markdown and PDF
    - `gps`: GPX and KML tracks: convert, distance and time
    - `qr`: Create QR codes and barcodes; r
    … 700 more characters
  3. I’m using the local `deft` file tool first for this image extraction.

  4. deft find "extract first frame from GIF"
    output
    image frames   gif -> png...       Save each frame of an animated GIF as PNG
    image to-gif   image... -> gif     Animate images into a GIF: --fps 2
    video convert  video|gif -> video  Change container and codec: --to mp4|webm|mov|mkv
  5. deft image frames --help
    output
    deft image frames - Save each frame of an animated GIF as PNG
    
    Usage: deft image frames <gif>... [-o <dir>] [options]
    In: gif (each handled separately)   Out: png files in <name>-frames/
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft image frames anim.gif -o frames/
    
    Result fields: files
  6. deft image frames earth.gif -o <tmp>
    output
    ok image.frames earth.gif -> <tmp>  44 frames  1.32s
  7. ls -1 <tmp> | head
    output
    earth-001.png
    earth-002.png
    earth-003.png
    earth-004.png
    earth-005.png
    earth-006.png
    earth-007.png
    earth-008.png
    earth-009.png
    earth-010.png
  8. cp <tmp> frame.png && ls -l frame.png
    output
    -rw-r--r--@ 1 user  staff  62731 Nov  7 00:49 frame.png
  9. Saved the first frame of `earth.gif` as [frame.png](frame.png).

Output

frame.png 61.3 KB · 400x400
frame.png

CodexWith deft, skill as AGENTS.mdPassed2026-11-05

Time
27s
New tokens
13.1k
Total input
126.5k
Output tokens
0.8k
Commands
7
Failed
1

Trace

  1. I’ll inspect the GIF and use the local image tooling to extract its first frame to `frame.png` in this directory.

  2. deft image --help
    output
    deft image - commands (input -> output)
      info      image -> report  Format, dimensions, EXIF orientation, GPS
      compress  image -> image   Smaller file: --quality, --target-size 200KB
      convert   image -> image   Change format: --to png|jpg|webp|avif|gif|tiff|bmp|ico
      crop      image -> image   Cut a region: --box x,y,w,h or --aspect 16:9
      flip      image -> image   Mirror: --direction horizontal|vertical
      resize    image -> image   Scale: --size 800x, 1920x1080, 50%
      rotate    image -> image   Turn clockwise: --angle 90 (EXIF is applied first)
      strip     image -> image   Remove EXIF, GPS and text metadata
      to-pdf    image... -> pdf  One page per image, in the given order
    More: deft image <command> --help
  3. deft image info earth.gif
    output
    ok image.info earth.gif  400x400
    has_gps=false has_metadata=false height=400 orientation=1 width=400
  4. deft find "extract first frame gif"
    output
    video frames         video -> png|jpg...  Save frames as images: --fps 1 or --at 0:05,0:10
    archive extract      archive -> dir       Unpack into a folder
    sheet extract        sheet -> sheet       Take a sheet or range: --sheet, --range A1:D20
    video extract-audio  video -> audio       Save the soundtrack: --to mp3|m4a|wav|flac|ogg
    video to-gif         video -> gif         Animated GIF: --fps, --size, --from, --to-time
  5. deft image convert --help
    output
    deft image convert - Change format: --to png|jpg|webp|avif|gif|tiff|bmp|ico
    Same as: deft convert
    
    Usage: deft image convert <image>... [-o <image|dir>] [options]
    In: image (each handled separately)   Out: image (default <name>.<ext>)
    WebP output is lossless. Transparent areas become --background in JPEG.
    
    Options:
      --to <png|jpg|webp|avif|gif|tiff|bmp|ico>
          Target format (or give -o name.ext)
      --quality <n>                Quality for JPEG and AVIF (default 85)
      --background <color>         Fill for transparent areas in JPEG (default white)
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft image convert photo-1.jpg --to png -o photo.png
      deft image convert *.jpg --to webp -o web/
    
    Result fields: width, height
  6. The image tool supports frame extraction through its video command. I’m checking its timestamp syntax so I can request time zero and save only that frame.

  7. deft video frames --help
    output
    deft video frames - Save frames as images: --fps 1 or --at 0:05,0:10
    
    Usage: deft video frames <video>... [-o <dir>] [options]
    In: video (each handled separately)   Out: png|jpg files in <name>-frames/
    
    Options:
      --fps <number>               Frames per second
      --at <times>                 Exact times
      --to <png|jpg>               Image format (default jpg)
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft video frames clip.mp4 --at 0:01 -o shots/
      deft video frames clip.mp4 --fps 1 --to png -o frames/
    
    Result fields: files
    Needs: ffmpeg, ffprobe
  8. deft video frames earth.gif --at 0:00 --to png -o . (exit 3)
    output
    error INPUT_MISMATCH earth.gif: expected video, got gif
    hint: see deft find "gif frames"
  9. deft image convert earth.gif -o frame.png
    output
    ok image.convert earth.gif -> frame.png  400x400  0.04s
  10. Saved the first frame of `earth.gif` as [frame.png](frame.png).

Output

Its files were not kept in this run. The last line of the trace is its own report.

Claude Opus 5.5Without deftPassed2026-11-07

Time
8s
New tokens
8.3k
Total input
27.7k
Output tokens
0.3k
Commands
0
Failed
0

Trace

    Output

    frame.png 58.4 KB · 400x400
    frame.png

    Claude Opus 5.5With deft, skill installedPassedRead the skillUsed deft2026-11-07

    Time
    14s
    New tokens
    10.0k
    Total input
    74.4k
    Output tokens
    0.5k
    Commands
    0
    Failed
    0

    Trace

      Output

      ---
      name: deft
      description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it."
      ---
      
      # deft
      
      One local command for file jobs. Prefer it over writing Python or shell scripts.
      
      Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
      
      Groups:
      - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
      - `image`: Resize, crop, convert, compress, adjust, montage, OCR
      - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg)
      - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg)
      - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
      - `slides`: PowerPoint: extract text, Markdown outline
      - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert
      - `json`: JSON: convert, format, merge, diff, validate
      - `toml`: TOML: convert, format, merge, diff, validate
      - `xml`: XML: convert, format, merge, diff, validate
      - `yaml`: YAML: convert, format, merge, diff, validate
      - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
      - `html`: HTML to Markdown, text, Word and PDF
      - `epub`: E-books: info, to text, Markdown and PDF
      - `gps`: GPX and KML tracks: convert, distance and time
      - `qr`: Create QR codes and barcodes; read QR codes
      
      How to use it:
      1. Run `deft <group>` to list commands, or `deft find "<what you want>"` to search. If it says `no command does this`, use another tool.
      2. Run `deft <group> <command> --help` for options and examples.
      3. `deft convert <in> -o <out.ext>` converts between formats by extension.
      4. Results are one line starting with `ok`, `partial` or `error`; add `--json` to parse them. Errors include a `hint:` with the fix.
      
      Inputs are never overwritten; pass `--force` or `--in-place` to allow it. Globs and directories work as inputs; several inputs run in parallel.
      
      If `deft` is not installed, ask the user, then follow https://github.com/firstprayer/deft/blob/main/docs/INSTALL.md
      
      frame.png 61.3 KB · 400x400
      frame.png

      Claude CodeWithout deftNot run yet

      Claude CodeWith deftNot run yet