feat(image): decode images via jimp with resize and alpha flattening - #65
Open
Yancheng-s wants to merge 6 commits into
Open
feat(image): decode images via jimp with resize and alpha flattening#65Yancheng-s wants to merge 6 commits into
Yancheng-s wants to merge 6 commits into
Conversation
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First-class Image pipeline:
decodeImage()overjimp(PNG/JPEG/GIF/BMP/TIFF)with optional resize and alpha flattening, rendered by
ImageRenderableusinghalf-block cells with area-average downsampling.
Design rationale and open questions: #66
Changes
jimpas a real dependency, lazily imported so apps that never use imagesdon't pay its load cost
decodeImage(source, { width, height, background })— resize with aspectpreserved (or stretch with both dimensions), flatten transparency onto a
background color (default white;
background: falsekeeps alpha)ImageRenderable: half-block rendering (1×2 px per cell), area-averagedownsampling, explicit display sizes that survive
imageDataupdates,backgroundpropImagecomponent props +tui-imagehost tag wiring innodeOps/imagepage with a TabSelect render-mode selector (Kitty/Sixel tabs stubfuture graphics-protocol support), AGENTS.md updated
Test plan
vitest run src/components/Image.spec.ts src/renderer/nodeOps.spec.ts— all greenpnpm test:typesandpnpm lint— clean/imagepage