Skip to content

Latest commit

 

History

History
416 lines (311 loc) · 16.4 KB

File metadata and controls

416 lines (311 loc) · 16.4 KB



📷 AI ID Photo Generator Plugin (BuildingAI ID Photo)

Version License Nuxt 3 BuildingAI Extension AI ID Photo

👉 Try the App Marketplace Now

🚀 AI ID Photo is a professional and convenient intelligent ID photo processing tool. Simply upload a casual photo and intelligently change the background color with one click to meet the strict requirements of various official scenarios!

Built-in dozens of common ID photo size specifications with support for fully customizable ratios, ensuring every ID photo is accurate, compliant, and professional


📖 Table of Contents


🖼️ Interface Preview

ID Photo Generation

Simply upload a casual photo, intelligently recognize the portrait and replace the background, and generate a professional ID photo with one click.

Size Templates

Built-in dozens of common ID photo size specifications to meet various official requirements such as visas, exams, and resumes.

Background Replacement

Supports multiple standard ID photo background colors including red, blue, white, and gray.


🎯 Product Introduction

What is AI ID Photo Plugin?

BuildingAI ID Photo is an intelligent ID photo generation plugin integrated into the BuildingAI platform. It utilizes advanced AI portrait recognition and background replacement technology, allowing users to quickly generate professional ID photos that meet official standards by simply uploading a casual photo, without any professional photography or post-processing skills.

Core Value

Value Point Description
📸 Professional Quality AI intelligently recognizes portrait contours with precise cutout to ensure professionalism
Instant Generation Complete background replacement and size adjustment within seconds after upload
🎯 Standard Compliance Built-in dozens of official ID photo sizes ensuring compliance with various scenarios
💡 Simple Operation One-click operation without learning complex image processing software
💰 Cost Savings No need for professional photo studio, create standard ID photos at home

Use Cases

  • 📄 Visa Applications - Standard ID photos required for various country visas
  • 🎓 Exam Registration - ID photos for civil service exams, certifications, and various tests
  • 💼 Job Resumes - Professional photos for job applications
  • 🏛️ Official Documents - Photos for ID cards, passports, and other official documents
  • 🎫 Membership Cards - Photos required for various membership cards and work IDs
  • 🌟 Daily Needs - Various occasions requiring standard photos

✨ Features

Core Features

Feature Description Icon
Smart Cutout AI automatically recognizes portrait contours and precisely separates person from background 🤖✂️
Background Replacement Supports multiple standard ID photo background colors including red, blue, white, and gray 🎨🖼️
Size Adjustment Built-in dozens of common ID photo size templates with one-click adaptation 📐📏
Custom Size Support for fully customizable width-height ratios to meet special requirements ⚙️📋
HD Output Support for high-resolution output ensuring print quality 🖨️✨
Batch Processing Support for generating multiple sizes of ID photos from the same photo 🔄📱

Auxiliary Features

Feature Description
📜 History Automatically save all generation records with support for viewing, downloading, and deletion
💾 Local Download Support for downloading in multiple formats for subsequent use
🔍 Preview Zoom Preview effects before generation to ensure satisfaction before downloading
📱 Responsive Interface Support for use on mobile phones, tablets, computers, and other terminals
🌐 Multi-language Support Support for Chinese, English, and other multi-language interfaces

🛠 Technical Architecture

Technology Stack

BuildingAI Extension Architecture:

  • Extension Framework: BuildingAI Extension SDK v25.1.0+
  • Frontend Technology: Nuxt 3 + Vue 3 + TypeScript
  • UI Components: BuildingAI UI Component Library + Nuxt UI
  • Image Processing: Canvas API + AI Background Removal Technology
  • Backend Integration: BuildingAI Core + Service + HTTP Module
  • Database: BuildingAI DB (PostgreSQL + TypeORM)
  • User System: BuildingAI unified user authentication and permission management
  • Storage Service: BuildingAI unified storage service

Core Dependencies:

  • AI Engine: Intelligent portrait recognition and background replacement technology
  • Computing Power Management: BuildingAI credit billing system
  • Multi-language: BuildingAI i18n internationalization
  • Build Tools: tsup + concurrently

Project Structure

buildingai-id-photo/
├── src/
│   ├── api/                      # Backend extension modules
│   │   ├── db/                   # Database layer
│   │   │   ├── entities/         # Entity definitions
│   │   │   │   ├── id-photo-record.entity.ts    # ID photo records
│   │   │   │   ├── id-photo-config.entity.ts    # Configuration management
│   │   │   │   └── size-template.entity.ts      # Size templates
│   │   │   ├── migrations/       # Database migrations
│   │   │   └── seeds/           # Seed data
│   │   └── modules/             # Business modules
│   │       ├── web/             # Frontend API endpoints
│   │       ├── console/         # Admin console endpoints
│   │       └── example/         # Example modules
│   └── web/                     # Frontend application
│       ├── components/          # Vue components
│       │   └── TemplateList.vue # Size template component
│       ├── pages/               # Route pages
│       │   ├── index.vue        # Main page
│       │   └── console/         # Admin pages
│       ├── services/            # API service layer
│       │   ├── web/id-photo.ts  # ID photo service
│       │   └── console/         # Admin services
│       ├── assets/              # Static resources
│       │   ├── background-*.png # Background color images
│       │   ├── example-*.png    # Example images
│       │   └── id-photo-demo.gif # Demo animation
│       ├── stores/              # State management
│       ├── i18n/                # Multi-language
│       └── models/              # Type definitions
├── manifest.json                # Extension manifest
└── package.json                # Project configuration

Core Workflow

ID Photo Generation Flow Diagram

sequenceDiagram
    participant User as User
    participant WebUI as Frontend UI
    participant Extension as Extension Backend
    participant BuildingAI as BuildingAI Platform
    participant AIEngine as AI Engine
    participant Storage as Storage Service
    
    User->>WebUI: 1. Upload casual photo
    WebUI->>Extension: 2. Submit processing request
    Extension->>BuildingAI: 3. Verify user permissions and credits
    BuildingAI-->>Extension: 4. Return verification result
    Extension->>AIEngine: 5. AI smart cutout processing
    AIEngine-->>Extension: 6. Return portrait contour
    Extension->>Extension: 7. Background replacement and size adjustment
    Extension->>Storage: 8. Save processed ID photo
    Extension->>BuildingAI: 9. Deduct credits/Save record
    Extension-->>WebUI: 10. Return ID photo result
    WebUI-->>User: 11. Display and download ID photo
Loading

Detailed Step Description

  1. Photo Upload: User uploads casual photo, system automatically validates format and size
  2. AI Recognition: Intelligently recognizes portrait contours and precisely separates person from background
  3. Background Replacement: Replaces with standard ID photo background color based on user selection
  4. Size Adjustment: Adjusts photo ratio and resolution according to selected size template
  5. Quality Optimization: Automatically optimizes photo brightness and contrast to ensure professional results
  6. Preview Confirmation: Provides preview function for user confirmation before generation
  7. Batch Generation: Supports generating multiple size specifications of ID photos at once
  8. Result Saving: Saves to user records with support for downloading and management anytime

📱 User Manual

User Guide

Step 1: Enter ID Photo Generation Page

Find and click the "AI ID Photo" plugin in the BuildingAI platform to enter the ID photo generation page.

Step 2: Upload Casual Photo

Click the upload area and select a clear casual photo.

📸 Photo Requirements:

✅ Recommended photo characteristics:
- Clear portrait with proper facial features
- Sufficient lighting without shadow obstruction
- Simple background, easy to recognize
- Front-facing shot with natural expression

❌ Avoid photo characteristics:
- Blurry or low pixel quality
- Side face or upward/downward angle shots
- Hats, masks, or other obstructions
- Complex background or multiple people

Photo Specification Recommendations:

  • 📏 Size: Recommended 800x800 pixels or above
  • 🎨 Format: Supports JPG, PNG formats
  • 💾 File Size: Not exceeding 5MB
  • 📐 Ratio: Face occupies about 1/3 of the photo
  • 💡 Lighting: Even lighting, avoid strong shadows

Step 3: Select ID Photo Specification

Select the required ID photo size from built-in templates or customize the size.

Common Specification Size (pixels) Use Case
1-inch Photo 295×413 ID cards, student IDs, etc.
2-inch Photo 413×579 Passports, visas, etc.
Small 2-inch 413×531 Driver's license, various documents
US Visa 600×600 US visa specific
Japan Visa 450×450 Japan visa specific
Korea Visa 350×450 Korea visa specific
Custom User-defined Special requirement scenarios

Step 4: Select Background Color

Choose the background color that meets requirements:

Background Color Use Case Color Reference
🔴 Red ID cards, work IDs, etc. #FF0000
🔵 Blue Passports, visas, etc. #438EDB
White Driver's license, resume photos, etc. #FFFFFF
Gray Various exam registrations, etc. #C0C0C0

Step 5: Generate and Download

Click the "Generate ID Photo" button, and the system will automatically process and generate a professional ID photo.

After generation is complete, you can:

  • 🔍 Preview: Confirm if the result is satisfactory
  • 💾 Download: Save to local device
  • 🔄 Regenerate: Adjust parameters and reprocess
  • 📋 Batch Download: Download multiple sizes at once

Admin Console Configuration

Administrators can configure the following in the backend:

1. API Key Configuration

Path: Console → ID Photo Configuration → Key Configuration

Configuration Item Description
AI Service URL Portrait recognition and background processing service address
Access Key AI service access key
Secret Key AI service secret key

2. Credit Consumption Configuration

Path: Console → ID Photo Configuration → Billing Configuration

Processing Type Default Credits Description
Basic ID Photo 50 Standard background replacement
HD ID Photo 100 High-resolution processing
Batch Processing 200 Multiple sizes generated simultaneously

3. Size Template Management

Path: Console → Size Template Management

  • Add Template: Create new ID photo size specifications
  • Edit Template: Modify parameters and names of existing templates
  • Enable/Disable: Control whether templates are displayed on frontend
  • Delete Template: Remove unwanted size specifications

4. Background Color Configuration

Path: Console → ID Photo Configuration → Background Configuration

Configure optional background color options and corresponding color values to ensure generated ID photos meet various official standards.


💰 Credit System

Billing Rules

The system uses credit-based billing, with different processing types consuming different credits:

Processing Type Default Credits Description
Basic ID Photo 50 Standard background replacement and size adjustment
HD ID Photo 100 High-resolution output suitable for printing
Batch Processing 200 Generate multiple size specifications simultaneously
Custom Size 80 Custom processing for non-standard sizes

❓ FAQ

Q1: What to do if ID photo generation fails?

Possible causes and solutions:

  • ✅ Check if uploaded photo is clear and front-facing
  • ✅ Confirm photo format is JPG or PNG
  • ✅ Check if photo size is within 5MB
  • ✅ Try uploading a photo with a simpler background

Q2: Generated ID photo quality is not ideal?

Optimization suggestions:

  • 📸 Use well-lit, clear original photos
  • 👤 Ensure face occupies appropriate proportion of photo (about 1/3)
  • 🖼️ Select photos with simple backgrounds for upload
  • 🎯 Avoid side faces, upward shots, and other non-frontal angles

Q3: How to obtain AI processing service key?

  1. Visit the corresponding AI service provider console
  2. Register/Login to account
  3. Enable "Portrait Processing" or "Image Recognition" service
  4. Create Access Key in key management
  5. Configure the key in admin console

Q4: What ID photo sizes are supported?

Supports including but not limited to:

  • 1-inch ID Photo - 295×413 pixels
  • 2-inch ID Photo - 413×579 pixels
  • Small 2-inch - 413×531 pixels
  • US Visa Photo - 600×600 pixels
  • Passport Photo - 390×567 pixels
  • Custom Size - Support for fully customizable ratios

Q5: Can generated ID photos be used for official purposes?

Generated ID photos meet general official standards, but it is recommended to:

  • Carefully verify specific size and background color requirements for the scenario
  • Ensure original photo quality is sufficiently high-definition
  • For important uses, consult specific requirements of relevant departments first

📄 License

This project is released under the BuildingAI License.


🤝 Contact Us


📷 Let AI create professional ID photos for you!