Citizen
Citizen is a powerful image processing tool focused on implementing various advanced dithering algorithms, allowing you to transform images into artistic halftone visuals.
Key Features
1. Dithering Algorithms
- None: Keep the original image
- Bayer Dithering: Apply Bayer matrix dithering
- Floyd–Steinberg Dithering: Classic error diffusion algorithm
- Atkinson Dithering: Apply Atkinson dithering method
- Blue Noise Dithering: Use blue noise pattern for dithering
- Halftone: Simulate traditional printing halftone effect
2. Image Adjustments
- Contrast Adjustment: Adjust image contrast
- Brightness Adjustment: Adjust image brightness
- Color Mapping: Support custom two-color mapping
3. Special Features
- Power Mode: Toggle special effects on/off
- Real-Time Preview: Instantly preview all adjustments
- Image Upload: Upload local images for processing
- Export: Save processed images
Technical Implementation
Core Algorithms
- Uses Canvas API for image processing
- Multiple dithering algorithms implemented in TypeScript
- 3D preview rendering via Three.js
State Management
- Custom Hook for managing application state
- Image texture state management
- Real-time processing progress updates
Usage
-
Upload Image
- Click the upload button to select a local image
- Supports common formats (PNG, JPG, etc.)
-
Select Algorithm
- Choose a dithering algorithm from the dropdown
- Real-time preview for each algorithm
-
Adjust Parameters
- Use sliders to adjust contrast and brightness
- Select or define custom color mapping
- Adjust Bayer dithering level (if applicable)
-
Export Result
- Click export to save processed image
- Supports copy to clipboard
Development Notes
File Structure
AdvancedDithering.tsx
: Main componentalgo.ts
: Algorithm implementationsPlayCanvas.tsx
: 3D preview componentuseStore.ts
: State managementpage.tsx
: Page entrylayout.tsx
: Layout component
Dependencies
- Three.js: 3D rendering
- React: UI framework
- TypeScript: Type support
- Lucide Icons: Icon library
Notes
- Large images may take longer to process
- Some algorithms (e.g., Blue Noise) require extra resource files
- Modern browsers recommended for best performance
Last updated on