claude-code - 💡(How to fix) Fix [BUG] Image quality degradation [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56236Fetched 2026-05-06 06:33:31
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3renamed ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When Claude Code reads image files (PNG, JPG, WebP) using the Read tool, the images are being recompressed/re-encoded. The file size and visual quality change compared to the original file on disk.

Real-world impact: I work with images that get used on a website. When I have Claude Code read/process images as part of my workflow (e.g. reviewing assets, comparing variants, picking final versions), the version Claude sees and operates on is already degraded. By the time the image lands on the web, it has been recompressed at least once by Claude Code on top of any other pipeline compression — resulting in visible quality loss (artifacts around text, banding in gradients, softening of fine detail).

For anyone using Claude Code as part of an asset/content pipeline, this means:

Final web images are lower quality than the source files Claude is making decisions (which crop, which variant, etc.) based on a degraded preview, not the actual asset There's no warning or option to opt out

What Should Happen?

The Read tool should pass image bytes through losslessly, OR provide an explicit option to read the original file without re-encoding. If a size cap is necessary for the model context, it should:

Preserve the original file on disk untouched (this may already be true — but worth confirming) Be transparent: report when an image has been downscaled/recompressed and by how much Allow a --raw / lossless mode for image-pipeline workflows

Error Messages/Logs

Steps to Reproduce

  1. Save a high-quality PNG to disk, e.g. /tmp/source.png — note ls -la /tmp/source.png (file size) and dimensions
  2. In Claude Code: read /tmp/source.png
  3. Ask Claude to report the dimensions / size of what it received
  4. Compare against the original file on disk
  5. Observe: size and/or quality differ from the source

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.126

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

The Read tool in Claude Code should be modified to pass image bytes through losslessly or provide an option to read the original file without re-encoding to prevent quality loss.

Guidance

  • Investigate the image processing pipeline in Claude Code to identify where the recompression/re-encoding is occurring.
  • Consider adding a --raw or lossless mode to the Read tool to allow users to opt out of compression for image-pipeline workflows.
  • Verify that the original file on disk remains untouched and that any modifications are transparently reported.
  • Test the Read tool with different image formats (PNG, JPG, WebP) to ensure consistent behavior.

Example

No code snippet is provided as the issue does not contain sufficient technical details.

Notes

The solution may require modifications to the Claude Code's image processing pipeline, and the feasibility of adding a lossless mode depends on the underlying implementation.

Recommendation

Apply a workaround by modifying the Read tool to pass image bytes through losslessly or adding a --raw mode, as this would directly address the reported issue and prevent quality loss.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Image quality degradation [1 participants]