A modern web-based image processing tool that transforms uploaded images through four powerful processing features: intelligent resizing, AI-powered coloring, line art conversion, and advanced line thickness reduction.
- Intelligent Resize: Transform images to specific aspect ratios while preserving important visual elements
- AI Image Coloring: Convert line art into colored illustrations with multiple artistic styles
- Line Art Conversion: Convert photos/colored images to clean line art for coloring activities
- Line Thickness Reduction: Advanced morphological thinning to reduce all lines to exactly 1-pixel width using Zhang-Suen skeleton algorithm
- Modern React + TypeScript: Built with React 18 and TypeScript for type safety
- Responsive Design: Works seamlessly across desktop, tablet, and mobile devices
- Drag & Drop Upload: Intuitive file upload with drag-and-drop support
- Real-time Processing: Live preview and processing status updates
- Canvas Processing: Server-side image manipulation with HTML5 Canvas API
- State Management: Efficient state handling with Zustand
- Smooth Animations: Enhanced UX with Framer Motion animations
- Bilingual Support: Full English and Vietnamese localization
- Frontend Framework: React 18 with TypeScript
- Build Tool: Vite for fast development and optimized builds
- Styling: Custom CSS with utility classes (Tailwind-inspired)
- State Management: Zustand for lightweight, efficient state handling
- File Upload: React Dropzone for drag-and-drop functionality
- Icons: Lucide React for beautiful, consistent icons
- Animations: Framer Motion for smooth, premium interactions
- Image Processing: HTML5 Canvas API with node-canvas for server-side processing
- API Processing: FAL.AI for advanced AI features, custom Canvas algorithms for morphological operations
- Deployment: Vercel with serverless functions for scalable processing
web-app/
├── src/
│ ├── components/
│ │ ├── ui/ # Reusable UI components (Button, Card, etc.)
│ │ ├── layout/ # Layout components (Header, Footer, Layout)
│ │ └── features/ # Feature-specific components
│ ├── hooks/ # Custom React hooks
│ ├── services/ # API and processing services
│ ├── stores/ # Zustand state stores
│ ├── types/ # TypeScript type definitions
│ ├── utils/ # Utility functions and constants
│ └── App.tsx
├── api/ # Vercel serverless API functions
│ ├── upload.ts # File upload to FAL.AI storage
│ ├── resize.ts # Intelligent image resizing
│ ├── coloring.ts # AI-powered image coloring
│ ├── lineArt.ts # Line art conversion
│ └── lineThinner.ts # Canvas-based line thickness reduction
├── dev-server/ # Local development API server
│ ├── routes/ # Express.js API route handlers
│ └── index.js # Development server entry point
├── public/ # Static assets
└── package.json
- Node.js 18+ and npm
-
Navigate to the web-app directory:
cd web-app -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production build locallynpm run lint- Run ESLint (when configured)
- Upload Images: Drag and drop images onto the upload area or click to browse files
- Configure Processing: Choose which processing steps to apply:
- Resize: Transform to specific aspect ratios (A4, Square, Portrait, Landscape, etc.)
- Coloring: AI-powered colorization with various artistic styles
- Line Art: Convert photos to clean line drawings for coloring
- Line Thickness: Reduce all lines to exactly 1-pixel width using morphological thinning
- Set Parameters: Adjust settings for each processing step
- Process: Watch as your images are transformed in real-time
- Download: Save your processed images
- Input: PNG, JPEG, GIF, WebP
- Output: PNG, JPEG, WebP
- Max File Size: 50MB per image (increased for development and line processing)
The line thickness reduction feature implements the Zhang-Suen morphological thinning algorithm to convert thick lines into single-pixel skeletons while preserving topology and connectivity.
Key Features:
- Exact 1-pixel lines: Reduces all strokes to exactly 1-pixel width
- Topology preservation: Maintains line connectivity and structure
- Configurable iterations: Adjustable processing strength (1-20 iterations)
- Output styles: Black-on-white or white-on-black output
- Endpoint preservation: Optional setting to maintain line endpoints
- Canvas-based processing: No external API dependencies, fully self-contained
Technical Implementation:
- Pure JavaScript implementation of Zhang-Suen algorithm
- Server-side Canvas API processing using node-canvas
- Binary image conversion with configurable thresholding
- Morphological operations for skeleton extraction
- Real-time processing with comprehensive error handling
Use Cases:
- Converting hand-drawn sketches to clean digital lines
- Preparing line art for digital coloring applications
- Creating consistent stroke weights across artwork
- Processing scanned drawings for digital use
- ImageStore: Central state management for uploaded images and processing pipeline
- useFileUpload: Custom hook handling drag-and-drop file uploads
- HeroSection: Landing page hero with feature highlights
- UploadSection: File upload interface with drag-and-drop support
- Create components in appropriate directories (
/components/features/,/components/ui/) - Add types in
/types/index.ts - Use Zustand store for state management
- Follow existing patterns for styling and animations
- Use semantic CSS classes for component styling
- Follow utility-first approach for layouts and spacing
- Maintain consistent spacing, colors, and typography
- Ensure responsive design across all screen sizes
- Fast Development: Vite provides instant hot module replacement
- Optimized Builds: Automatic code splitting and tree shaking
- Efficient State: Zustand provides minimal re-renders
- Lazy Loading: Components and assets loaded on demand
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Follow the existing code structure and patterns
- Use TypeScript for all new code
- Ensure responsive design
- Add proper error handling
- Test across different browsers and devices
This project is part of the ImagePlex application suite.