Categories: CSSScriptWeb Design

Convert Images Into Stickers With JavaScript – Create-sticker

The create-sticker JavaScript library takes your images, specifically those with transparent backgrounds in .png, .webp, and .jpg formats, and applies a customizable sticker effect.

This means you can adjust the color and thickness of the sticker outline, decide whether to fill in any holes in the image, and even add padding around the image.

How it works:

Create-Sticker uses HTML Canvas to manipulate images. The main steps are:

  1. Load the image onto a canvas.
  2. Detect the image outline.
  3. Apply the sticker effect (stroke, padding, etc.).
  4. Fill holes if specified.
  5. Return the modified image as a data URL.

How to use it:

1. Install & download.

# NPM
$ npm install @devadri/create-sticker

2. Import create-sticker into your project.

// ES Module
import { createSticker, CreateStickerOptions } from '@devadri/create-sticker';

// Browser
<script src="/path/to/bundle.iife.js"></script>

3. Apply a customizable sticker effect to your image. The code snippet shown below fetches the image source, defines the desired customization options, and then applies the sticker effect using the createSticker function. Finally, it updates the image source with the modified version.

// Browser
async function modifyImage(img) {
  const options = {
    // options here
  }
  const stickerImgSrc = await CreateSticker.createSticker(img.src, options);
  img.src = stickerImgSrc;
}
// ES Module
async function modifyImage(img) {
  const options: CreateStickerOptions = {
    // options here
  }
  const stickerImgSrc = await createSticker(img.src, options);
  img.src = stickerImgSrc;
}

4. Available options to customize the sticker effect.

{
  "strokeWidth": 20,
  "strokeColor": "white",
  "padding": 1,
  "fillHoles": true
}

Changelog:

v1.2.0 (04/11/2026)

  • Bugfixes

The post Convert Images Into Stickers With JavaScript – Create-sticker appeared first on CSS Script.

rssfeeds-admin

Share
Published by
rssfeeds-admin

Recent Posts

ALERT: Severe storms this weekend posing threat of high wind, hail, tornadoes

BIG COUNTRY, TEXAS (KTAB/KRBC) -The Storm Prediction Center has placed the western half of the Big Country…

12 minutes ago

Texas Tech System to end sexual orientation & gender identity degrees, limit course content

Texas Tech University System Chancellor Brandon Creighton sent a letter to university presidents detailing how…

12 minutes ago

Crime Reports: Fight breaks out at Abilene group home

Editor’s Note: The Abilene Police Department supplied the following arrest and incident reports. All information…

12 minutes ago

Suspect charged with murder for fentanyl overdose in Abilene teen’s death

ABILENE, Texas (KTAB/KRBC) - A suspect has been charged with Murder in connection to a…

12 minutes ago

Wake-Up Weather: spotty showers with storms possible

Wake-Up Weather: spotty showers with storms possible

12 minutes ago

Disney Extraction Shooter Reportedly in Development at Epic Games

Fortnite developer Epic Games is reportedly working on a new extraction shooter featuring Disney characters…

42 minutes ago

This website uses cookies.