Posts

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Image Converter Tool

Image Converter Tool







Convert Another Image
function convert() { const fileInput = document.getElementById('file'); const formatInput = document.getElementById('format'); const message = document.getElementById('message'); // check if a file is selected if (!fileInput.files[0]) { message.innerHTML = "Please select a file"; return; } // check if the selected file is an image const fileName = fileInput.files[0].name; const extension = fileName.split('.').pop().toLowerCase(); if (!['jpg', 'jpeg', 'png', 'bmp'].includes(extension)) { message.innerHTML = "Please select an image file"; return; } // create a new image object from the selected file const reader = new FileReader(); reader.onload = function(event) { const img = new Image(); img.onload = function() { // create a canvas element to draw the image const canvas = document.createElement('canvas'); canvas.width = img.width; canvas.height = img.height; const context = canvas.getContext('2d'); context.drawImage(img, 0, 0); // convert the image to the selected format const format = formatInput.value; const dataURL = canvas.toDataURL(`image/${format}`); // create a link element to download the converted image file const link = document.createElement('a'); link.download = fileName.replace(`.${extension}`, `.${format}`); link.href = dataURL; link.click(); } img.src = event.target.result; } reader.readAsDataURL(fileInput.files[0]); message.innerHTML = "File converted successfully"; }

Getting Info...

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.