Spaces:
Running
Running
Build a app that unblurs any image and very clear
Browse files- README.md +8 -5
- index.html +294 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Image Clarify Pro
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Image Clarify Pro 🔍
|
| 3 |
+
colorFrom: blue
|
| 4 |
+
colorTo: yellow
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
index.html
CHANGED
|
@@ -1,19 +1,295 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Image Clarify Pro | Unblur Any Image</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
.dropzone {
|
| 13 |
+
border: 2px dashed #cbd5e0;
|
| 14 |
+
transition: all 0.3s ease;
|
| 15 |
+
}
|
| 16 |
+
.dropzone-active {
|
| 17 |
+
border-color: #4f46e5;
|
| 18 |
+
background-color: #eef2ff;
|
| 19 |
+
}
|
| 20 |
+
.result-image {
|
| 21 |
+
transition: all 0.5s ease;
|
| 22 |
+
filter: blur(8px);
|
| 23 |
+
}
|
| 24 |
+
.result-image.unblurred {
|
| 25 |
+
filter: blur(0);
|
| 26 |
+
animation: sharpen 1.5s ease-out;
|
| 27 |
+
}
|
| 28 |
+
@keyframes sharpen {
|
| 29 |
+
0% { filter: blur(8px); }
|
| 30 |
+
100% { filter: blur(0); }
|
| 31 |
+
}
|
| 32 |
+
.processing-animation {
|
| 33 |
+
animation: pulse 2s infinite;
|
| 34 |
+
}
|
| 35 |
+
@keyframes pulse {
|
| 36 |
+
0%, 100% { opacity: 0.6; }
|
| 37 |
+
50% { opacity: 1; }
|
| 38 |
+
}
|
| 39 |
+
</style>
|
| 40 |
+
</head>
|
| 41 |
+
<body class="bg-gray-50 min-h-screen flex flex-col">
|
| 42 |
+
<!-- Header -->
|
| 43 |
+
<header class="bg-gradient-to-r from-indigo-600 to-purple-600 text-white shadow-lg">
|
| 44 |
+
<div class="container mx-auto px-4 py-6">
|
| 45 |
+
<div class="flex items-center justify-between">
|
| 46 |
+
<div class="flex items-center space-x-2">
|
| 47 |
+
<i data-feather="eye" class="w-8 h-8"></i>
|
| 48 |
+
<h1 class="text-2xl md:text-3xl font-bold">Image Clarify Pro</h1>
|
| 49 |
+
</div>
|
| 50 |
+
<nav>
|
| 51 |
+
<ul class="flex space-x-6">
|
| 52 |
+
<li><a href="#" class="hover:underline">Home</a></li>
|
| 53 |
+
<li><a href="#" class="hover:underline">How It Works</a></li>
|
| 54 |
+
<li><a href="#" class="hover:underline">About</a></li>
|
| 55 |
+
</ul>
|
| 56 |
+
</nav>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
</header>
|
| 60 |
+
|
| 61 |
+
<!-- Main Content -->
|
| 62 |
+
<main class="flex-grow container mx-auto px-4 py-12">
|
| 63 |
+
<div class="text-center mb-12">
|
| 64 |
+
<h2 class="text-3xl md:text-4xl font-bold text-gray-800 mb-4">Unblur Any Image Instantly</h2>
|
| 65 |
+
<p class="text-lg text-gray-600 max-w-2xl mx-auto">Upload your blurry photo and watch our AI magic transform it into a crystal clear image!</p>
|
| 66 |
+
</div>
|
| 67 |
+
|
| 68 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
| 69 |
+
<!-- Upload Section -->
|
| 70 |
+
<div class="bg-white rounded-xl shadow-lg p-6">
|
| 71 |
+
<div id="dropzone" class="dropzone rounded-lg p-8 flex flex-col items-center justify-center cursor-pointer h-64">
|
| 72 |
+
<i data-feather="upload" class="w-12 h-12 text-indigo-500 mb-4"></i>
|
| 73 |
+
<h3 class="text-xl font-semibold text-gray-700 mb-2">Drag & Drop Your Image</h3>
|
| 74 |
+
<p class="text-gray-500 mb-4">or click to browse files</p>
|
| 75 |
+
<input type="file" id="fileInput" class="hidden" accept="image/*">
|
| 76 |
+
<button id="uploadBtn" class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
|
| 77 |
+
Select Image
|
| 78 |
+
</button>
|
| 79 |
+
</div>
|
| 80 |
+
<div class="mt-6">
|
| 81 |
+
<h4 class="font-medium text-gray-700 mb-2">Image Settings</h4>
|
| 82 |
+
<div class="space-y-4">
|
| 83 |
+
<div>
|
| 84 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Blur Intensity</label>
|
| 85 |
+
<input type="range" id="blurSlider" min="0" max="10" value="5" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
|
| 86 |
+
<div class="flex justify-between text-xs text-gray-500 mt-1">
|
| 87 |
+
<span>Low</span>
|
| 88 |
+
<span>Medium</span>
|
| 89 |
+
<span>High</span>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
<div>
|
| 93 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Enhance Details</label>
|
| 94 |
+
<div class="flex items-center space-x-4">
|
| 95 |
+
<label class="inline-flex items-center">
|
| 96 |
+
<input type="radio" name="enhance" checked class="form-radio text-indigo-600">
|
| 97 |
+
<span class="ml-2">Standard</span>
|
| 98 |
+
</label>
|
| 99 |
+
<label class="inline-flex items-center">
|
| 100 |
+
<input type="radio" name="enhance" class="form-radio text-indigo-600">
|
| 101 |
+
<span class="ml-2">High</span>
|
| 102 |
+
</label>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<!-- Result Section -->
|
| 110 |
+
<div class="bg-white rounded-xl shadow-lg p-6">
|
| 111 |
+
<div id="resultContainer" class="rounded-lg p-8 flex flex-col items-center justify-center bg-gray-100 h-64">
|
| 112 |
+
<i data-feather="image" class="w-12 h-12 text-gray-400 mb-4"></i>
|
| 113 |
+
<h3 class="text-xl font-semibold text-gray-700 mb-2">Your Clear Image Will Appear Here</h3>
|
| 114 |
+
<p class="text-gray-500 text-center">After processing, you'll see the magic happen!</p>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="mt-6 hidden" id="actionButtons">
|
| 117 |
+
<div class="flex flex-col sm:flex-row space-y-3 sm:space-y-0 sm:space-x-3">
|
| 118 |
+
<button class="flex-1 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition flex items-center justify-center space-x-2">
|
| 119 |
+
<i data-feather="download" class="w-4 h-4"></i>
|
| 120 |
+
<span>Download</span>
|
| 121 |
+
</button>
|
| 122 |
+
<button class="flex-1 px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition flex items-center justify-center space-x-2">
|
| 123 |
+
<i data-feather="share-2" class="w-4 h-4"></i>
|
| 124 |
+
<span>Share</span>
|
| 125 |
+
</button>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<!-- Features Section -->
|
| 132 |
+
<div class="mt-16">
|
| 133 |
+
<h2 class="text-2xl font-bold text-center text-gray-800 mb-8">How It Works</h2>
|
| 134 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
| 135 |
+
<div class="bg-white p-6 rounded-xl shadow-md text-center">
|
| 136 |
+
<div class="w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 137 |
+
<i data-feather="upload" class="w-8 h-8 text-indigo-600"></i>
|
| 138 |
+
</div>
|
| 139 |
+
<h3 class="text-xl font-semibold mb-2">Upload Your Image</h3>
|
| 140 |
+
<p class="text-gray-600">Simply drag and drop your blurry image or select it from your device.</p>
|
| 141 |
+
</div>
|
| 142 |
+
<div class="bg-white p-6 rounded-xl shadow-md text-center">
|
| 143 |
+
<div class="w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 144 |
+
<i data-feather="cpu" class="w-8 h-8 text-indigo-600"></i>
|
| 145 |
+
</div>
|
| 146 |
+
<h3 class="text-xl font-semibold mb-2">AI Processing</h3>
|
| 147 |
+
<p class="text-gray-600">Our advanced algorithms analyze and enhance every pixel of your image.</p>
|
| 148 |
+
</div>
|
| 149 |
+
<div class="bg-white p-6 rounded-xl shadow-md text-center">
|
| 150 |
+
<div class="w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 151 |
+
<i data-feather="download" class="w-8 h-8 text-indigo-600"></i>
|
| 152 |
+
</div>
|
| 153 |
+
<h3 class="text-xl font-semibold mb-2">Download Result</h3>
|
| 154 |
+
<p class="text-gray-600">Get your crystal clear image ready to use in seconds.</p>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
</main>
|
| 159 |
+
|
| 160 |
+
<!-- Footer -->
|
| 161 |
+
<footer class="bg-gray-800 text-white py-8">
|
| 162 |
+
<div class="container mx-auto px-4">
|
| 163 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 164 |
+
<div class="mb-6 md:mb-0">
|
| 165 |
+
<div class="flex items-center space-x-2">
|
| 166 |
+
<i data-feather="eye" class="w-6 h-6"></i>
|
| 167 |
+
<span class="text-xl font-bold">Image Clarify Pro</span>
|
| 168 |
+
</div>
|
| 169 |
+
<p class="text-gray-400 mt-2">Making blurry images crystal clear since 2023</p>
|
| 170 |
+
</div>
|
| 171 |
+
<div class="flex space-x-6">
|
| 172 |
+
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 173 |
+
<i data-feather="github"></i>
|
| 174 |
+
</a>
|
| 175 |
+
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 176 |
+
<i data-feather="twitter"></i>
|
| 177 |
+
</a>
|
| 178 |
+
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 179 |
+
<i data-feather="instagram"></i>
|
| 180 |
+
</a>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
<div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400 text-sm">
|
| 184 |
+
<p>© 2023 Image Clarify Pro. All rights reserved.</p>
|
| 185 |
+
</div>
|
| 186 |
+
</div>
|
| 187 |
+
</footer>
|
| 188 |
+
|
| 189 |
+
<script>
|
| 190 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 191 |
+
feather.replace();
|
| 192 |
+
|
| 193 |
+
const dropzone = document.getElementById('dropzone');
|
| 194 |
+
const fileInput = document.getElementById('fileInput');
|
| 195 |
+
const uploadBtn = document.getElementById('uploadBtn');
|
| 196 |
+
const resultContainer = document.getElementById('resultContainer');
|
| 197 |
+
const actionButtons = document.getElementById('actionButtons');
|
| 198 |
+
const blurSlider = document.getElementById('blurSlider');
|
| 199 |
+
|
| 200 |
+
// Handle drag and drop
|
| 201 |
+
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
| 202 |
+
dropzone.addEventListener(eventName, preventDefaults, false);
|
| 203 |
+
});
|
| 204 |
+
|
| 205 |
+
function preventDefaults(e) {
|
| 206 |
+
e.preventDefault();
|
| 207 |
+
e.stopPropagation();
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
['dragenter', 'dragover'].forEach(eventName => {
|
| 211 |
+
dropzone.addEventListener(eventName, highlight, false);
|
| 212 |
+
});
|
| 213 |
+
|
| 214 |
+
['dragleave', 'drop'].forEach(eventName => {
|
| 215 |
+
dropzone.addEventListener(eventName, unhighlight, false);
|
| 216 |
+
});
|
| 217 |
+
|
| 218 |
+
function highlight() {
|
| 219 |
+
dropzone.classList.add('dropzone-active');
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
function unhighlight() {
|
| 223 |
+
dropzone.classList.remove('dropzone-active');
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
dropzone.addEventListener('drop', handleDrop, false);
|
| 227 |
+
uploadBtn.addEventListener('click', () => fileInput.click());
|
| 228 |
+
|
| 229 |
+
fileInput.addEventListener('change', function() {
|
| 230 |
+
if (this.files.length) {
|
| 231 |
+
handleFiles(this.files);
|
| 232 |
+
}
|
| 233 |
+
});
|
| 234 |
+
|
| 235 |
+
function handleDrop(e) {
|
| 236 |
+
const dt = e.dataTransfer;
|
| 237 |
+
const files = dt.files;
|
| 238 |
+
if (files.length) {
|
| 239 |
+
handleFiles(files);
|
| 240 |
+
}
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
function handleFiles(files) {
|
| 244 |
+
const file = files[0];
|
| 245 |
+
if (!file.type.match('image.*')) {
|
| 246 |
+
alert('Please upload an image file.');
|
| 247 |
+
return;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
const reader = new FileReader();
|
| 251 |
+
reader.onload = function(e) {
|
| 252 |
+
// Show processing animation
|
| 253 |
+
resultContainer.innerHTML = `
|
| 254 |
+
<div class="processing-animation flex flex-col items-center">
|
| 255 |
+
<div class="w-16 h-16 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin mb-4"></div>
|
| 256 |
+
<p class="text-gray-700">Processing your image...</p>
|
| 257 |
+
</div>
|
| 258 |
+
`;
|
| 259 |
+
|
| 260 |
+
// Simulate AI processing with timeout
|
| 261 |
+
setTimeout(() => {
|
| 262 |
+
// Create blurred version for demo purposes
|
| 263 |
+
const img = document.createElement('img');
|
| 264 |
+
img.src = e.target.result;
|
| 265 |
+
img.classList.add('rounded-lg', 'max-h-60', 'result-image');
|
| 266 |
+
img.style.filter = `blur(${blurSlider.value}px)`;
|
| 267 |
+
|
| 268 |
+
resultContainer.innerHTML = '';
|
| 269 |
+
resultContainer.appendChild(img);
|
| 270 |
+
actionButtons.classList.remove('hidden');
|
| 271 |
+
|
| 272 |
+
// Simulate unblurring effect after a delay
|
| 273 |
+
setTimeout(() => {
|
| 274 |
+
img.classList.add('unblurred');
|
| 275 |
+
}, 500);
|
| 276 |
+
}, 2000);
|
| 277 |
+
};
|
| 278 |
+
reader.readAsDataURL(file);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
// Update blur preview when slider changes
|
| 282 |
+
blurSlider.addEventListener('input', function() {
|
| 283 |
+
const img = resultContainer.querySelector('img');
|
| 284 |
+
if (img) {
|
| 285 |
+
img.style.filter = `blur(${this.value}px)`;
|
| 286 |
+
img.classList.remove('unblurred');
|
| 287 |
+
setTimeout(() => {
|
| 288 |
+
img.classList.add('unblurred');
|
| 289 |
+
}, 100);
|
| 290 |
+
}
|
| 291 |
+
});
|
| 292 |
+
});
|
| 293 |
+
</script>
|
| 294 |
+
</body>
|
| 295 |
</html>
|