Heritage Reviver is a web-based application designed to bring history to life. It allows users to upload photographs of aged or ruined heritage sites and uses a powerful AI model to generate a restored version, showing what the site might have looked like in its original, pristine condition.
The goal is to digitally revive history, making it more accessible and engaging for tourists, students, historians, and anyone with a passion for cultural heritage.
This project is a single-file, frontend-only application that directly communicates with Google's Generative AI services.
- Simple Image Upload: An intuitive drag-and-drop interface and a traditional file browser for easy photo uploads.
- AI-Powered Restoration: Utilizes Google's
gemini-2.5-flash-image-previewmodel to analyze the uploaded image and perform a detailed, photorealistic reconstruction. - Interactive Before & After Comparison: A smooth, responsive slider allows users to seamlessly compare the original photo with the AI-restored version.
- Download Functionality: Users can download the restored image as a high-quality PNG file to save or share.
- Responsive Design: The interface is built with Tailwind CSS to be fully responsive and user-friendly on both desktop and mobile devices.
- Error Handling: A user-friendly modal appears if the AI fails to process an image, ensuring a smooth user experience.
- Frontend:
- HTML5
- Tailwind CSS for styling.
- Vanilla JavaScript for all client-side logic.
- AI Model:
- Google's Gemini 2.5 Flash with Image Preview for image understanding and generation.
This is a self-contained web application. No complex setup is required.
- Save the Code: Save the
heritage_reviver.htmlfile to your local machine. - Open in Browser: Open the file directly in any modern web browser (like Chrome, Firefox, or Safari).
- Upload an Image: Drag and drop a photo of a heritage site onto the upload area, or click "Browse Files" to select one from your computer.
- Wait for Restoration: The application will show a loading indicator while it communicates with the AI model.
- Compare and Download: Once complete, use the slider to compare the before and after images. Click the "Download Restored Photo" button to save the result.
The restorations generated by the AI are artistic and speculative interpretations based on the provided image. They are not guaranteed to be historically exact reconstructions. The quality of the output is highly dependent on the quality and clarity of the uploaded photograph.