Please bookmark this page to avoid losing your image tool!

Image Cousin Finder

(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, relationshipType = "First Cousin", hueVariation = 45) {
    const canvas = document.createElement("canvas");
    const ctx = canvas.getContext("2d");
    
    // Determine the "degree" of the cousin based on the string input
    let degree = 1;
    let relationshipStr = String(relationshipType).toLowerCase();
    
    if (relationshipStr.includes("second")) {
        degree = 2;
    } else if (relationshipStr.includes("third")) {
        degree = 3;
    } else if (relationshipStr.includes("distant")) {
        degree = 5;
    } else if (!isNaN(Number(relationshipType))) {
        degree = Number(relationshipType) || 1;
    }

    const variation = Number(hueVariation) || 45;
    
    // Mutate the "genetics" (aspect ratio) slightly based on the relationship degree
    const stretchX = 1 + (degree * 0.05);
    const stretchY = Math.max(0.5, 1 - (degree * 0.03));
    
    canvas.width = originalImg.width * stretchX;
    canvas.height = originalImg.height * stretchY;
    
    // Build "genetic variations" (CSS filters)
    const hueShift = (degree * variation) % 360;
    const contrast = 1 + (degree * 0.05);
    const blurAmount = degree >= 4 ? ` blur(${degree - 2}px)` : "";
    
    ctx.filter = `hue-rotate(${hueShift}deg) saturate(1.1) contrast(${contrast})${blurAmount}`;
    
    // Apply "genetic mirrors" (flipping the image context)
    // First cousins and third cousins get flipped horizontally
    if (degree % 2 !== 0) {
        ctx.translate(canvas.width, 0);
        ctx.scale(-1, 1);
    }
    
    // Second cousins and beyond sometimes get flipped vertically
    if (degree >= 2 && degree % 2 === 0) {
        ctx.translate(0, canvas.height);
        ctx.scale(1, -1);
    }
    
    // Render the cousin image
    ctx.drawImage(originalImg, 0, 0, canvas.width, canvas.height);
    
    return canvas;
}

Free Image Tool Creator

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

Description

The Image Cousin Finder is a creative tool that generates stylized visual variations of an uploaded image based on specified familial relationship types. By simulating ‘genetic’ mutations, the tool applies transformations such as aspect ratio adjustments, hue shifts, contrast changes, and blurring, along with horizontal or vertical flipping, to mimic how a relative might look. This tool can be used for artistic projects, social media filters, or as a fun way to create themed digital variations of portraits.

Leave a Reply

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