# Add support for Netpbm image previews \(\#54256\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4d78f26c27048f121071bf6c9c6d29f59874d18e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4d78f26c27048f121071bf6c9c6d29f59874d18e

Requested commit: 4d78f26c27048f121071bf6c9c6d29f59874d18e

Commit: 4d78f26c27048f121071bf6c9c6d29f59874d18e

Tree: a6379886eb33a5d0cd3761402fd7e5c201b6f336

Author: Vinícius Dutra

Committer: GitHub

## Message

```
Add support for Netpbm image previews (#54256)

This PR adds support for rendering **Netpbm** image formats (`.pbm`,
`.ppm`, `.pgm`) within Zed's built-in image viewer.

These formats are particularly useful for projects that want minimal
external dependencies, a common scenario in academic environments and
low-level graphics programming.

Since the underlying `image` crate and `GPUI` already provide support
for these codecs, this change explicitly exposes the `Pnm` variant
within `gpui::ImageFormat` by mapping it to `image::ImageFormat::Pnm`.

## Screenshots/Examples

Below is an example of `.pbm`, `.ppm`, and `.pgm` files being rendered
correctly in the image preview (images taken from
https://filesamples.com):
<img width="1917" height="1012" alt="pnm_example"
src="https://github.com/user-attachments/assets/0056133f-908c-4c91-ba9d-53aef0657b05"
/>



Release Notes:
  - Added support for PNM image previews (`.pbm`, `.ppm`, `.pgm`).
```

## Parents

- [b204582f7e901d140961ac2eb0d6c2fdb7a30043](https://git.cafe/gitcafe/zed/commit/b204582f7e901d140961ac2eb0d6c2fdb7a30043?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4d78f26c27048f121071bf6c9c6d29f59874d18e?format=markdown)
