Skip to content

Use AI to add color to a black and white photo using Python and FireMonkey.

License

Notifications You must be signed in to change notification settings

FMXExpress/AI-Image-Colorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Image Colorizer + Replicate API

This is a desktop application built with DelphiFMX that allows you to upload a grayscale image and automatically colorize it using the Replicate API. The app provides an easy-to-use interface for selecting images, displaying the original grayscale image alongside the colorized version, and managing the processing status.

Features

  • Image Upload: Select a grayscale image (.png, .jpg, or .jpeg).
  • Image Display: View the original and colorized images side by side.
  • Status Updates: See real-time status messages while the image is being processed.
  • Replicate API: Uses the piddnad/ddcolor model from Replicate for colorization.
  • Responsive Design: Clean, responsive layout built with DelphiFMX.
  • Error Handling: Displays error messages if image processing fails.

Prerequisites

  1. Python: This application requires Python to be installed on your system.
  2. Replicate API Key: You will need a Replicate API Key to run the app. Once you have the key, set it as an environment variable:
    export REPLICATE_API_TOKEN="your_replicate_api_key"

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/ai-image-colorizer-fmx.git
    cd ai-image-colorizer-fmx
  2. Install required Python packages: Ensure that you have replicate installed:

    pip install replicate
  3. Run the Application: You can run the application directly using Python:

    python colorizier.py

Usage

  1. Upload an Image: Click the "Select" button and choose a grayscale image (.png, .jpg, or .jpeg) from your local system.
  2. Wait for Processing: The status bar will show updates on the colorization progress. The colorization is done using the piddnad/ddcolor model from Replicate.
  3. View the Results: Once the colorization is complete, the original grayscale image and the newly colorized image will be displayed side by side.

Project Structure

ai-image-colorizer-fmx/
│
├── colorizer.py            # Main entry point for the application
├── Air.style          # DelphiFMX style used for the UI
└── README.md          # This README file

Models Used

The application uses the piddnad/ddcolor model for colorizing grayscale images. You can view more details about the model on its Replicate page.

Notes

  • API Limitations: Ensure that your Replicate account has enough credits to run the colorization model.
  • Performance: The image processing time will vary depending on the size of the image and the speed of the Replicate model.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Use AI to add color to a black and white photo using Python and FireMonkey.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages