pytorch / pytorch/vision

Image decoders feature support

Open
#9,542 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

Just opening this for ref

  Legend: Y = supported · — = not applicable / no code path · N = explicitly unsupported (raises) · warn = accepted but ignored with a warning

  ┌───────────────────────────────┬───────────────────┬───────────────────────────┬────────────────────────────┬────────────┬────────────────┬──────────────────┬───────────────────┬─────────────────────┐
  │            Feature            │ decode_jpeg (CPU) │ decode_jpeg (CUDA nvJPEG) │ decode_jpeg (CUDA rocJPEG) │ decode_png │  decode_webp   │    decode_gif    │    decode_avif    │     decode_heic     │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Format                        │ JPEG              │ JPEG                      │ JPEG                       │ PNG        │ WebP           │ GIF              │ AVIF              │ HEIC                │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ In this repo?                 │ Y                 │ Y                         │ Y                          │ Y          │ Y              │ Y                │ No (external pkg) │ No (external pkg)   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Underlying lib                │ libjpeg           │ nvJPEG                    │ rocJPEG                    │ libpng     │ libwebp        │ vendored giflib  │ libavif           │ libheif             │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Mode: UNCHANGED               │ Y                 │ Y                         │ Y                          │ Y          │ Y              │ — (always RGB)   │ Y                 │ Y                   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Mode: GRAY                    │ Y                 │ Y                         │ Y                          │ Y          │ warn→unchanged │ —                │ N (→unchanged)    │ N (→unchanged)      │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Mode: GRAY_ALPHA              │ N (raise)         │ N (raise)                 │ N (raise)                  │ Y          │ warn→unchanged │ —                │ N (→unchanged)    │ N (→unchanged)      │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Mode: RGB                     │ Y                 │ Y                         │ Y                          │ Y          │ Y              │ —                │ Y                 │ Y                   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Mode: RGB_ALPHA (RGBA)        │ N (raise)         │ N (raise)                 │ N (raise)                  │ Y          │ Y              │ —                │ Y                 │ Y                   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ CPU                           │ Y                 │ —                         │ —                          │ Y          │ Y              │ Y                │ Y                 │ Y                   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ CUDA / GPU                    │ —                 │ Y (NVIDIA)                │ Y (AMD)                    │ —          │ —              │ —                │ —                 │ —                   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Alpha channel                 │ — (n/a)           │ — (n/a)                   │ — (n/a)                    │ Y          │ Y              │ compositing only │ Y                 │ Y                   │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ 16-bit / >8-bit output        │ — (8-bit only)    │ 8-bit only                │ 8-bit only                 │ Y (uint16) │ 8-bit only     │ 8-bit only       │ Y (10/12→uint16)  │ Y (10/12/16→uint16) │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Batch (list input)            │ list (loops)      │ Y (true HW batch)         │ Y                          │ No         │ No             │ No               │ No                │ No                  │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Multi-frame / animation       │ —                 │ —                         │ —                          │ —          │ N (rejected)   │ Y (4-D N,C,H,W)  │ N (errors >1 img) │ primary image only  │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ apply_exif_orientation        │ Y                 │ No                        │ No                         │ Y          │ No             │ No               │ No                │ No                  │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Auto-detected by decode_image │ Y                 │ (via CPU)                 │ —                          │ Y          │ Y              │ Y                │ No                │ No                  │
  ├───────────────────────────────┼───────────────────┼───────────────────────────┼────────────────────────────┼────────────┼────────────────┼──────────────────┼───────────────────┼─────────────────────┤
  │ Platform                      │ all               │ all + NVIDIA              │ all + AMD                  │ all        │ all            │ all              │ Linux-only, beta  │ Linux-only, beta    │
  └───────────────────────────────┴───────────────────┴───────────────────────────┴────────────────────────────┴────────────┴────────────────┴──────────────────┴───────────────────┴─────────────────────┘

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names decode_image and the decoder entry points decode_jpeg, decode_png, decode_webp, decode_gif, decode_avif, and decode_heic, but no files or tests. Start by locating those entry points and the existing decoder tests, then confirm the support matrix against the implementation. Done requires an agreed documentation scope and a verified, maintainable feature reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.