npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-soulmate-sketch-filter

v1768297.341.138

Published

Professional integration for https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/

Readme

ai-soulmate-sketch-filter

A JavaScript utility to apply a stylized sketch filter, simulating a hand-drawn portrait, to images. Enhance your image processing workflows with this unique artistic effect.

Installation

Install the package using npm: bash npm install ai-soulmate-sketch-filter

Usage Examples

Here are several ways you can integrate ai-soulmate-sketch-filter into your JavaScript projects:

1. Basic Image Processing in Node.js: javascript const aiSoulmateSketchFilter = require('ai-soulmate-sketch-filter'); const fs = require('fs'); const { createCanvas, loadImage } = require('canvas');

async function applySketchFilter(inputImagePath, outputImagePath) { try { const image = await loadImage(inputImagePath); const canvas = createCanvas(image.width, image.height); const ctx = canvas.getContext('2d'); ctx.drawImage(image, 0, 0, image.width, image.height);

const imageData = ctx.getImageData(0, 0, image.width, image.height);
const filteredImageData = aiSoulmateSketchFilter(imageData);

ctx.putImageData(filteredImageData, 0, 0);

const buffer = canvas.toBuffer('image/png');
fs.writeFileSync(outputImagePath, buffer);
console.log(`Sketch filter applied. Output saved to: ${outputImagePath}`);

} catch (error) { console.error('Error processing image:', error); } }

// Example usage: applySketchFilter('input.jpg', 'output_sketch.png');

2. Applying the Filter in a Browser Environment: html

3. Using with a Web API (Example with Express.js): javascript const express = require('express'); const aiSoulmateSketchFilter = require('ai-soulmate-sketch-filter'); const { createCanvas, loadImage } = require('canvas'); const app = express(); const port = 3000;

app.get('/sketch', async (req, res) => { try { const imageUrl = req.query.url; // Expect an image URL as a query parameter if (!imageUrl) { return res.status(400).send('Please provide an image URL.'); }

const image = await loadImage(imageUrl);
const canvas = createCanvas(image.width, image.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0, image.width, image.height);

const imageData = ctx.getImageData(0, 0, image.width, image.height);
const filteredImageData = aiSoulmateSketchFilter(imageData);

ctx.putImageData(filteredImageData, 0, 0);
const buffer = canvas.toBuffer('image/png');

res.writeHead(200, {
  'Content-Type': 'image/png',
  'Content-Length': buffer.length
});
res.end(buffer);

} catch (error) { console.error('Error processing image:', error); res.status(500).send('Error processing image.'); } });

app.listen(port, () => { console.log(Server listening at http://localhost:${port}); });

4. Using with a React Component: jsx import React, { useState, useEffect, useRef } from 'react'; import aiSoulmateSketchFilter from 'ai-soulmate-sketch-filter';

function SketchFilterComponent({ imageUrl }) { const [sketchDataUrl, setSketchDataUrl] = useState(null); const canvasRef = useRef(null);

useEffect(() => { const loadImageAndApplyFilter = async () => { const canvas = canvasRef.current; const ctx = canvas.getContext('2d'); const image = new Image();

  image.onload = () => {
    canvas.width = image.width;
    canvas.height = image.height;
    ctx.drawImage(image, 0, 0, image.width, image.height);

    const imageData = ctx.getImageData(0, 0, image.width, image.height);
    const filteredImageData = aiSoulmateSketchFilter(imageData);

    ctx.putImageData(filteredImageData, 0, 0);
    setSketchDataUrl(canvas.toDataURL());
  };

  image.src = imageUrl;
};

loadImageAndApplyFilter();

}, [imageUrl]);

return ( <canvas ref={canvasRef} style={{ display: 'none' }} /> {sketchDataUrl && } ); }

export default SketchFilterComponent;

API Summary

The ai-soulmate-sketch-filter package exposes a single function: javascript aiSoulmateSketchFilter(imageData: ImageData): ImageData

  • imageData: An ImageData object representing the image to be processed. This object contains the pixel data of the image.
  • Returns: A new ImageData object with the sketch filter applied.

License

MIT

This package is part of the ai-soulmate-sketch-filter ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/