Claude Charges Images by Pixels: Compress Text into PNGs to Save Tokens

jbarbier · x · 2026-07-06

jbarbier pointed out that Claude charges for image inputs based on pixel dimensions rather than text content. Therefore, you can compress large blocks of context into a dense PNG image and pay via pixels instead of tokens.

He shared a code repository implementing this idea, offering a practical engineering trick to reduce API costs.

Original post →

More from coding & agent

coding & agent channel →