diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1b729d --- /dev/null +++ b/README.md @@ -0,0 +1,104 @@ +# Dekupai ๐ŸŠ +### *Premium Glassmorphic AI Background Remover & Decoupage Studio* + +Developed by **Turunรงgil AI**, **Dekupai** is a state-of-the-art desktop application built on **ElectronJS** that leverages the cutting-edge **BiRefNet** (Bilateral Reference Network) deep learning model for extremely high-resolution, pixel-perfect background extraction and image matting. + +With a beautiful, modern **Glassmorphic interface** themed with glowing neon citrus accents, **Dekupai** bridges the gap between complex AI segmentation workflows and elite creator utilities, enabling instant edge-accurate transparent subject isolation, visual cropping, auto-trimming, custom background compositing, and professional asset exporting. + +--- + +## โœจ Features + +- ๐ŸŠ **Turunรงgil Brand Accentuation**: Stunning glassmorphic dark theme styled with heavy back-filters (`backdrop-filter: blur(28px)`) and organic glowing neon orange and golden orbs. +- ๐Ÿง  **BiRefNet Neural Engine**: State-of-the-art segmentation that handles intricate visual details (e.g. hair, thin lines, translucent materials) using a lightweight CPU-optimized local inference pipeline. +- โš™๏ธ **Integrated Environment Setup**: An automated initial setup overlay that checks, builds, and configures an isolated Python virtual environment (`.venv`) and downloads requirements automatically. +- ๐Ÿ“ **Interactive Cropper Studio**: Full integration with `Cropper.js` enabling precise bounding boxes, standard aspect presets (Square, Story, Cinema, Portrait), 90-degree rotations, and horizontal/vertical mirroring. +- โšก **Native Auto-Trim**: A high-performance client-side pixel iteration algorithm that scans the active transparent alpha borders and instantly snaps the crop boundaries tight around your subject. +- ๐ŸŽจ **Creative Background Compositor**: + - **Transparent Mode**: Keeps alpha transparency (perfect for png stickers and web assets). + - **Solid Colors**: Burns clean flat fills with quick-selection swatches and a custom color wheel picker. + - **Premium Gradients**: Composes gorgeous, pre-curated linear gradients behind your isolated subject in real-time. +- ๐Ÿ’พ **Lossless Export Studio**: Composite and save final assets to **PNG (transparent)**, **JPEG**, or **WebP** formats with configurable quality parameter sliders using native system dialogs and helpful "Show in Folder" explorer shortcut notifications. + +--- + +## ๐Ÿ“‚ Directory Tree + +The project structure is organized cleanly as follows: + +```text +Dekupai/ +โ”œโ”€โ”€ backend/ +โ”‚ โ”œโ”€โ”€ requirements.txt # Python dependency library list (torch, transformers, timm, einops, etc.) +โ”‚ โ”œโ”€โ”€ setup.py # Automated virtual environment builder and dependency installer +โ”‚ โ””โ”€โ”€ process.py # BiRefNet background segmentation processor (runs local AI inference) +โ”œโ”€โ”€ node_modules/ # Electron & frontend packages (Ignored in Git) +โ”œโ”€โ”€ .git/ # Git tracking files +โ”œโ”€โ”€ .venv/ # Python isolated environment (Ignored in Git) +โ”œโ”€โ”€ .gitignore # Git ignore instructions +โ”œโ”€โ”€ package.json # Node project scripts, metadata, and dependencies +โ”œโ”€โ”€ package-lock.json # Node dependency lock file +โ”œโ”€โ”€ main.js # Electron main process (IPC handlers, dialogs, python executors) +โ”œโ”€โ”€ preload.js # Secure sandbox context bridge mapping IPC communications +โ”œโ”€โ”€ index.html # Main HTML5 layout and inline SVG vectors +โ”œโ”€โ”€ styles.css # Glassmorphism styling variables, colors, and layout configurations +โ”œโ”€โ”€ renderer.js # Renderer logic, drag-drop loops, cropper lifecycles, and export generators +โ””โ”€โ”€ README.md # Project documentation (This file) +``` + +--- + +## ๐Ÿš€ Getting Started + +### Prerequisites + +Ensure you have the following installed on your machine: +* [Node.js](https://nodejs.org/) (v18 or above recommended) +* [Python](https://www.python.org/) (v3.10 to v3.12 recommended) +* [Git](https://git-scm.com/) + +### Installation & Run + +1. **Clone the Repository** (or move into the project directory): + ```bash + cd d:\Works\2026\BiRefNet + ``` + +2. **Install Node Dependencies**: + ```bash + npm install + ``` + +3. **Boot the Application**: + ```bash + npm start + ``` + +4. **Automatic AI Configuration**: + On your very first launch, the **DEKUPAI Initialization Wizard** will display. Click **Configure Engine (Automatic)**. The system will build a local virtual environment (`.venv`), upgrade pip, and install PyTorch CPU version, Hugging Face transformers, and runtime model dependencies. + + *All progress is streamed in real-time straight to your dashboard progress bar and system terminal window!* + +--- + +## ๐Ÿ“– Operational Guide + +### 1. Load an Image +* Drag and drop any `PNG`, `JPG`/`JPEG`, or `WebP` file directly onto the large glowing dragzone. +* Or, click **Browse Local Files** and pick an image from your explorer. + +### 2. Extract Background +* Click **Extract Subject** in the right-side control tower. +* The loader box will show real-time progress (`[STATUS] Loading model...`, `[STATUS] Running background removal...`). +* *Note: During the first extraction, the system will download the BiRefNet model weights (~200MB) from Hugging Face. This occurs only once and is cached for instant future runs.* + +### 3. Crop & Edit +* Toggle between the **Drag Mode** (navigate) and **Crop Selection** buttons at the bottom. +* Apply aspect constraints, rotate, or flip your image. +* Click **Auto-Trim** to instantly snap the bounding box securely around your transparent subject's non-empty pixels! + +### 4. Style & Export +* Select your background fill in Section 3: **Transparent**, **Solid**, or **Gradient**. +* In Section 4, pick your export format (PNG, JPEG, WebP) and adjust the quality slider. +* Click **Export Masterpiece**, choose your directory, and save. +* Click **Show in File Explorer** in the success toast to find your exported file instantly!