Add style controls, presets, and edge-aware variation quantization

This commit is contained in:
gary
2026-02-21 20:28:04 +01:00
parent a00d456d03
commit 4cbd4eb478
2 changed files with 361 additions and 47 deletions

View File

@@ -2,7 +2,7 @@
Prototype Flutter app for generating bottle-cap mosaics from imported images.
## Implemented MVP
## Features
- Import target image from gallery (`image_picker`)
- Resolution controls:
@@ -12,46 +12,50 @@ Prototype Flutter app for generating bottle-cap mosaics from imported images.
- list caps with name + color
- add color via picker and/or manual hex
- remove caps
- Mosaic generation:
- resize source to grid
- nearest cap color match using CIELAB + DeltaE (CIE76)
- fallback concept is RGB distance, but LAB path is implemented directly
- Output:
- mosaic grid preview
- bill of materials counts per cap color
- Mosaic preview + bill of materials counts per cap color
## Current blocker on this machine
## Style controls (new)
`flutter` SDK is not installed (`flutter: command not found`), so I could not run:
User-facing controls are integrated directly in the main screen:
- `flutter create`
- `flutter pub get`
- `flutter analyze`
- `flutter build apk --debug`
- **Fidelity ↔ Structure** slider
- fidelity side keeps direct color faithfulness
- structure side applies edge-aware smoothing for cleaner large forms
- **Dithering strength** slider
- scales FloydSteinberg error diffusion
- **Edge emphasis** slider
- boosts edge readability during color assignment
- **Color tolerance / variation** slider
- allows controlled variation among similar cap colors in flatter regions
## Setup commands (Ubuntu/Debian)
## Presets
Three presets are provided and selectable via segmented buttons:
- **Realistisch**
- **Ausgewogen**
- **Künstlerisch**
Selecting a preset sets all four style controls at once.
## Pipeline notes
The generation pipeline still uses fast CIELAB (`DeltaE CIE76`) nearest-color matching,
with precomputed palette LAB values, LAB caching, and low-cost edge-aware processing to keep performance responsive.
## Build (arm64 split debug)
```bash
cd /home/yadciel/.openclaw/workspace
sudo snap install flutter --classic
# OR: install manually from flutter.dev and add to PATH
flutter doctor
cd /home/yadciel/.openclaw/workspace/korken_mosaic
flutter create .
flutter pub get
flutter run
flutter build apk --debug
flutter build apk --debug --split-per-abi
```
Expected APK artifact:
Expected arm64 artifact:
`build/app/outputs/flutter-apk/app-debug.apk`
`build/app/outputs/flutter-apk/app-arm64-v8a-debug.apk`
## Project files
## Main files
- `lib/main.dart` complete MVP UI + mosaic logic
- `pubspec.yaml` dependencies
- `analysis_options.yaml`
- `.gitignore`
- `lib/main.dart` UI + mosaic logic
- `README.md` overview and build instructions