| | --- |
| | license: apache-2.0 |
| | task_categories: |
| | - text-classification |
| | language: |
| | - aa |
| | tags: |
| | - art |
| | pretty_name: rafa |
| | size_categories: |
| | - 1K<n<10K |
| | --- |
| | <!DOCTYPE html> |
| | <html lang="pt-BR"> |
| | <head> |
| | <meta charset="UTF-8"> |
| | <title>Image Auto Editor</title> |
| | <style> |
| | body { |
| | background: #0f0f0f; |
| | color: #fff; |
| | font-family: Arial, sans-serif; |
| | text-align: center; |
| | padding: 30px; |
| | } |
| | canvas, img { |
| | max-width: 90%; |
| | margin-top: 20px; |
| | border-radius: 10px; |
| | } |
| | input { |
| | margin-top: 20px; |
| | } |
| | </style> |
| | </head> |
| | <body> |
| | |
| | <h2>Colar ou Enviar Imagem</h2> |
| |
|
| | <input type="file" id="upload" accept="image/*"> |
| |
|
| | <canvas id="canvas"></canvas> |
| |
|
| | <script> |
| | const upload = document.getElementById("upload"); |
| | const canvas = document.getElementById("canvas"); |
| | const ctx = canvas.getContext("2d"); |
| | |
| | upload.addEventListener("change", (e) => { |
| | const file = e.target.files[0]; |
| | if (!file) return; |
| | |
| | const img = new Image(); |
| | img.onload = () => { |
| | canvas.width = img.width; |
| | canvas.height = img.height; |
| | |
| | // EFEITO AUTOMÁTICO |
| | ctx.filter = "contrast(110%) saturate(115%) sharpen(1)"; |
| | ctx.drawImage(img, 0, 0); |
| | }; |
| | |
| | img.src = URL.createObjectURL(file); |
| | }); |
| | |
| | // COLAR IMAGEM (CTRL + V) |
| | document.addEventListener("paste", (event) => { |
| | const items = event.clipboardData.items; |
| | for (let item of items) { |
| | if (item.type.includes("image")) { |
| | const blob = item.getAsFile(); |
| | const img = new Image(); |
| | img.onload = () => { |
| | canvas.width = img.width; |
| | canvas.height = img.height; |
| | ctx.filter = "contrast(110%) saturate(115%)"; |
| | ctx.drawImage(img, 0, 0); |
| | }; |
| | img.src = URL.createObjectURL(blob); |
| | } |
| | } |
| | }); |
| | </script> |
| | |
| | </body> |
| | </html> |