Skip to content

Add image resizing - #37

Merged
leerob merged 5 commits into
mainfrom
cursor/image-resolution-resizing-implementation-bd72
Dec 28, 2025
Merged

leerob merged 5 commits into
mainfrom
cursor/image-resolution-resizing-implementation-bd72

Conversation

@leerob

@leerob leerob commented Dec 27, 2025 •

Copy link
Copy Markdown
Owner

Add image resizing functionality with Nearest, Bilinear, and Lanczos3 algorithms, including WASM bindings, to allow for efficient image resolution changes.


Open in Cursor Open in Web


Note

Adds high-quality image resizing as a preprocessing step before encoding, with APIs, bindings, and UI.

  • New src/resize.rs providing ResizeAlgorithm (Nearest/Bilinear/Lanczos3) and resize/resize_into for all ColorTypes; exported via pub mod resize and ResizeAlgorithm in lib.rs
  • WASM: resizeImage added in src/wasm.rs (plus JS/TS bindings in web/src/lib/pixo-wasm/*) to resize raw pixels in-browser
  • Web: TypeScript wrapper resizeImage and helpers in web/src/lib/wasm.ts (including calculateResizeDimensions); Svelte UI adds Resize toggle, width/height inputs, aspect lock, algorithm select, and "Resize" action integrating with compression flow
  • Docs: README and docs/codebase-size-comparison.md updated (WASM size, test counts, features)
  • Dev deps pinned (image = 0.25.5, imagequant = 4.3.3); numerous unit tests for resize and wasm paths

Written by Cursor Bugbot for commit 85cae7e. This will update automatically on new commits. Configure here.

Implements image resizing functionality with three algorithms:
- Nearest neighbor: fastest, pixelated results (good for pixel art)
- Bilinear: fast, smooth results (good balance)
- Lanczos3: highest quality, slower (best for photographs)

Features:
- Full support for all color types (Gray, GrayAlpha, RGB, RGBA)
- Buffer reuse API via resize_into()
- WASM bindings via resizeImage() function
- Comprehensive test coverage

Also pins image and imagequant dev-dependencies to avoid
edition2024 compatibility issues with older Cargo versions.
@cursor

cursor Bot commented Dec 27, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercel Bot commented Dec 27, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
pixo Ready Ready Preview, Comment Dec 28, 2025 0:54am

- Regenerate WASM binary with resize support (149 KB, -0.1% from 152 KB)
- Update codebase-size-comparison.md with new metrics:
  - Total LOC: 33,113 → 34,268 (+1,155)
  - Core Code: 16,586 → 16,861 (+275)
  - Test Code: 16,527 → 17,407 (+880)
  - Test ratio: 49.9% → 50.8% (improved)
  - Test functions: 818 → 839 (+21)
- Add resizeImage() export to WASM TypeScript definitions
@leerob leerob changed the title Image resolution resizing implementation Add image resizing Dec 27, 2025
@leerob
leerob marked this pull request as ready for review December 27, 2025 18:12

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot.

You can kick off a cloud agent using @cursor - e.g. @cursor fix the bug in pixo.d.ts.

Comment thread web/src/lib/pixo-wasm/pixo.d.ts
Comment thread web/src/lib/wasm.ts
@leerob
leerob merged commit cfdbf04 into main Dec 28, 2025
9 checks passed

This branch was successfully deployed

1 active deployment
Preview — 85cae7e2 Deployed Dec 28, 2025 by vercel[bot]
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.

2 participants