Please bookmark this page to avoid losing your image tool!

Image To Website Interface Address Extractor

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, language = 'eng') {
    // Create the main container to return immediately
    const container = document.createElement('div');
    container.style.fontFamily = 'system-ui, -apple-system, sans-serif';
    container.style.padding = '20px';
    container.style.backgroundColor = '#f8f9fa';
    container.style.border = '1px solid #dee2e6';
    container.style.borderRadius = '8px';
    container.style.color = '#212529';
    container.style.lineHeight = '1.5';
    container.style.maxWidth = '100%';
    container.style.boxSizing = 'border-box';
    
    // Create loading state UI
    const loader = document.createElement('div');
    loader.innerHTML = `
        <div style="display: flex; align-items: center; gap: 10px;">
            <div style="width: 20px; height: 20px; border: 3px solid #ccc; border-top-color: #007bff; border-radius: 50%; animation: ocr-spin 1s linear infinite;"></div>
            <span>Extracting text via OCR... This may take a moment.</span>
        </div>
        <style>
            @keyframes ocr-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        </style>
    `;
    container.appendChild(loader);

    // Perform OCR asynchronously and update the container once complete
    (async () => {
        try {
            if (!originalImg || (!originalImg.src && !(originalImg instanceof HTMLCanvasElement))) {
                throw new Error("Source image is empty or invalid.");
            }

            // Draw Original Image to Canvas to obtain a clean Base64 to give to Tesseract.
            // This prevents common raw DOM cross-origin image issues.
            const canvas = document.createElement('canvas');
            canvas.width = originalImg.naturalWidth || originalImg.width || 800;
            canvas.height = originalImg.naturalHeight || originalImg.height || 600;
            const ctx = canvas.getContext('2d');
            ctx.drawImage(originalImg, 0, 0, canvas.width, canvas.height);
            const base64Img = canvas.toDataURL('image/png');

            // Dynamically Load Tesseract.js if not available
            if (!window.Tesseract) {
                await new Promise((resolve, reject) => {
                    const script = document.createElement('script');
                    script.src = 'https://cdn.jsdelivr.net/npm/tesseract.js@5/dist/tesseract.min.js';
                    script.onload = resolve;
                    script.onerror = () => reject(new Error("Failed to load Tesseract.js"));
                    document.head.appendChild(script);
                });
            }

            // Initialize Tesseract Worker and recognize text
            const worker = await window.Tesseract.createWorker(language);
            const { data: { text } } = await worker.recognize(base64Img);
            await worker.terminate();

            // Regular Expression to find website URLs
            // Matches standard protocols (http, https), www prefix, and typical TLD structures.
            const urlRegex = /(?:https?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{2,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi;
            
            const rawMatches = text.match(urlRegex) || [];

            // Clean, filter, and validate Matches
            const cleanUrls = rawMatches.map(url => url.replace(/[.,;:\s]+$/, '')) // strip trailing punctuation easily picked up by OCR
                .filter(url => {
                    // Exclude emails
                    if (url.includes('@') && !url.startsWith('http')) return false;

                    // Exclude tiny artifact matches
                    if (url.length < 5) return false;

                    // Enforce basic URL heuristics to prevent standard sentences (e.g. "Hi.There") from matching
                    // Usually valid TLDs or explicit protocols signify a true URL
                    const hasCommonStructure = /^(https?:\/\/|www\.)/i.test(url) || 
                                             /\.(com|org|net|edu|gov|io|co|us|uk|info|biz|me|tv|xyz|app|site)\b/i.test(url);
                    
                    return hasCommonStructure;
                });

            // Gather completely unique results
            const uniqueUrls = [...new Set(cleanUrls)];

            // Clear the loading UI from the container
            container.innerHTML = '';
            
            // Build the Extracted Results UI
            const header = document.createElement('h3');
            header.innerText = 'Extracted Website Addresses';
            header.style.marginTop = '0';
            header.style.paddingBottom = '10px';
            header.style.borderBottom = '1px solid #dee2e6';
            container.appendChild(header);

            if (uniqueUrls.length > 0) {
                const ul = document.createElement('ul');
                ul.style.paddingLeft = '20px';
                ul.style.listStyleType = 'disc';
                ul.style.margin = '15px 0';
                
                uniqueUrls.forEach(url => {
                    const li = document.createElement('li');
                    li.style.marginBottom = '8px';
                    
                    const a = document.createElement('a');
                    // Ensure proper href prefixing for clickable links
                    const href = /^https?:\/\//i.test(url) ? url : `https://${url}`;
                    a.href = href;
                    a.target = '_blank';
                    a.rel = 'noopener noreferrer';
                    a.innerText = url;
                    a.style.color = '#007bff';
                    a.style.textDecoration = 'none';
                    a.style.wordBreak = 'break-all';
                    
                    a.onmouseover = () => { a.style.textDecoration = 'underline'; };
                    a.onmouseout = () => { a.style.textDecoration = 'none'; };

                    li.appendChild(a);
                    ul.appendChild(li);
                });
                
                container.appendChild(ul);
            } else {
                const emptyMsg = document.createElement('p');
                emptyMsg.innerText = 'No structured website addresses were detected in the image.';
                emptyMsg.style.color = '#6c757d';
                emptyMsg.style.fontStyle = 'italic';
                container.appendChild(emptyMsg);
            }

            // Provide raw text in an expandable spoiler for manual inspection fallback
            const details = document.createElement('details');
            details.style.marginTop = '20px';
            
            const summary = document.createElement('summary');
            summary.innerText = 'View extracted raw text';
            summary.style.cursor = 'pointer';
            summary.style.color = '#495057';
            summary.style.fontWeight = 'bold';
            summary.style.fontSize = '0.9em';
            summary.style.userSelect = 'none';
            details.appendChild(summary);
            
            const pre = document.createElement('pre');
            pre.innerText = text.trim() || '(No recognized text content)';
            pre.style.backgroundColor = '#e9ecef';
            pre.style.padding = '12px';
            pre.style.borderRadius = '6px';
            pre.style.fontSize = '0.85em';
            pre.style.overflowX = 'auto';
            pre.style.whiteSpace = 'pre-wrap';
            pre.style.marginTop = '10px';
            pre.style.border = '1px solid #ced4da';
            details.appendChild(pre);

            container.appendChild(details);

        } catch (err) {
            // Render error states neatly within the container
            container.innerHTML = '';
            const errorMsg = document.createElement('div');
            errorMsg.style.color = '#dc3545';
            errorMsg.style.backgroundColor = '#f8d7da';
            errorMsg.style.border = '1px solid #f5c6cb';
            errorMsg.style.padding = '15px';
            errorMsg.style.borderRadius = '6px';
            errorMsg.innerHTML = `<strong>Error processing image:</strong> ${err.message}`;
            container.appendChild(errorMsg);
        }
    })();

    // Container is returned immediately and can be appended to the DOM (.html, .append, etc).
    // The visual content will resolve smoothly inside the container after the OCR finishes.
    return container;
}

Free Image Tool Creator

Can't find the image tool you're looking for?
Create one based on your own needs now!

Description

This tool uses Optical Character Recognition (OCR) technology to scan images and automatically identify and extract website URLs. It processes the text within an image, filters out irrelevant data like email addresses, and provides a clean, clickable list of unique web addresses found. This tool is useful for quickly gathering links from screenshots, digital flyers, business cards, or advertisements without the need for manual typing.

Leave a Reply

Your email address will not be published. Required fields are marked *

Other Image Tools:

Image Prompt Idea Generator and Tool Creator Studio

MP4 DVDRip Video and Photo Language Dubbing Translator Player

Music Audio Mp3 Song Lyric Extractor

Video Platform Audio Track and Language Localization Text Translator

Image Description Text Generator

Video Platform Audio Track and Localization Metadata Screenshot Tool

Video Audio Track and Language Translator Tool

Video and Audio Metadata and Format Information Extractor Tool

Video Platform Screenshot and Rip Effect Converter

YouTube Video Audio Track and Auto Dubbing Translator Player

YouTube Auto-Dubbing Multi-Language Audio Track Translator Tool

Video Platform Audio Track and Text Language Translator Tool

AI Video Language Dubbing and Translation Generator

Image To Movie Name and Film Title Extractor

Online Image Tools

Photo Face Mask Adder

YouTube Video To Image Frame Extractor

Image Translation and Language Tool

TV Logo Compilation Image Creator

Image Food Delivery Service Tool

Image To Target Language Dubbing Text Translator

Image Search Tools

Image and Video Player

Image Flip and Reverse Tool

Three Photo Mediateka

Image Description Identifier Tool

Two Photo Comparison Search Tool

Image Name Official Tool

Video Audio Track Language Dubbing Translator Tool

Multi Language HiFi VHSRip and DVDRip Audio Player

Image To Stylized Character Hero Generator

AI Image Idea Generator

Image Topic Search and Mediateka Creator Tool

Image Based Advanced Movie Identifier Search Tool

Image Movie Identifier Advanced Search Tool

Image Aspect Ratio Calculator By Numbers

See All →