Posts

Showing posts from December, 2023
Image to ASCII Art Converter body { font-family: 'Courier New', monospace; text-align: center; margin: 20px; } input { margin-bottom: 20px; } function convertImageToASCII() { const imageInput = document.getElementById('imageInput'); const asciiOutput = document.getElementById('asciiOutput'); const reader = new FileReader(); reader.onload = function (e) { const img = new Image(); img.src = e.target.result; img.onload = function () { const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); const aspectRatio = img.width / img.height; const maxWidth = 80; // Adjust the width as needed for your display let newWidth = maxWidth; let newHeight = maxWidth / aspectRatio; if (newHeight > 40) { newHeight = 40; // Li...

Photo

Image Editor Crop Rotate Apply Filter Download
let image = null; let canvas = document.getElementById('editorCanvas'); let ctx = canvas.getContext('2d'); function loadImage(input) { const file = input.files[0]; if (file) { const reader = new FileReader(); reader.onload = function (e) { image = new Image(); image.src = e.target.result; image.onload = function () { canvas.width = image.width; canvas.height = image.height; ctx.drawImage(image, 0, 0, canvas.width, canvas.height); }; }; reader.readAsDataURL(file); } } function cropImage() { // Add crop functionality } function rotateImage() { // Add rotate functionality } function applyFilter() { // Add filter functionality } function downloadImage() { const dataURL = canvas.toDataURL('image/png'); const link = document.createElement('a'); link.href = dataURL; link.download = 'edi...