Skip to content

feat(image): decode images via jimp with resize and alpha flattening - #65

Open
Yancheng-s wants to merge 6 commits into
vue-terminal:mainfrom
Yancheng-s:feat/image-component
Open

feat(image): decode images via jimp with resize and alpha flattening#65
Yancheng-s wants to merge 6 commits into
vue-terminal:mainfrom
Yancheng-s:feat/image-component

Conversation

@Yancheng-s

@Yancheng-s Yancheng-s commented Aug 5, 2026

Copy link
Copy Markdown

Summary

First-class Image pipeline: decodeImage() over jimp (PNG/JPEG/GIF/BMP/TIFF)
with optional resize and alpha flattening, rendered by ImageRenderable using
half-block cells with area-average downsampling.

Design rationale and open questions: #66

Changes

  • jimp as a real dependency, lazily imported so apps that never use images
    don't pay its load cost
  • decodeImage(source, { width, height, background }) — resize with aspect
    preserved (or stretch with both dimensions), flatten transparency onto a
    background color (default white; background: false keeps alpha)
  • ImageRenderable: half-block rendering (1×2 px per cell), area-average
    downsampling, explicit display sizes that survive imageData updates,
    background prop
  • Image component props + tui-image host tag wiring in nodeOps
  • Co-located tests (decode/resize/flatten/explicit-sizes/render), playground
    /image page with a TabSelect render-mode selector (Kitty/Sixel tabs stub
    future graphics-protocol support), AGENTS.md updated

Test plan

  • vitest run src/components/Image.spec.ts src/renderer/nodeOps.spec.ts — all green
  • pnpm test:types and pnpm lint — clean
  • Verified visually in the playground /image page

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

@Yancheng-s is attempting to deploy a commit to the posva's kitchen Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant