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 🙏

© 2024 – Pkg Stats / Ryan Hefner

editpix

v1.0.2

Published

Simple JavaScript library for image editing.

Downloads

18

Readme

Image

License: MIT Test on Main npm jsDelivr

A powerful and versatile image editing library for the browser.

Adjust brightness, contrast, saturation, and other image parameters. Apply filters and effects for creative transformations.

A complete list of the available features is available below.


Documentation

Please follow the documentation at the following link.

Installation

EditPix supports multiple different installation methods.

Usage in the browser

For use in the browser the library can be installed via npm or loaded via CDN.

Installing from npm

npm i editpix

In your HTML file, load the script as a module:

<script type="module" src="example.js"></script>

In your JavaScript file, import the library and use it:

import EditPix from './node_modules/editpix/src/editpix.js';

const editpix = new Editpix();

// use library

Loading from a CDN

In your HTML file, load the script as a module:

<script type="module" src="example.js"></script>

In your JavaScript file, import the library from the CDN and use it:

import EditPix from 'https://cdn.jsdelivr.net/npm/editpix/+esm';

const editpix = new Editpix();

// use library

You can also choose the version of the library you prefer by specifying it in the URL:

import EditPix from 'https://cdn.jsdelivr.net/npm/editpix@[version]/+esm';

Usage in Vue.js

Installing from npm

npm i editpix

Import and use in your component:

<script setup>

import EditPix from "editpix"

const editpix = new EditPix()

//use library

</script>

If it is useful to you, at the following link you can find a small example on how you can use EditPix with Vue.js 3 and the Composition API.


Features

  • Edit directly within the browser, without the need for Node
  • Easy to use functions, that do exactly what you'd expect from them

Currently implemented features:

  • Colorspace transforms:
    • RGB (to and from HSL, HEX)
    • HSL (to and from RGB)
    • HEX (to and from RGB)
  • Color filters:
    • Black and white
    • Grayscale
    • Sepia
  • Color adjustments:
    • Saturation
    • Temperature
    • Tint
  • Image resizing:
    • By target width
    • By target height
    • By percentage
  • Value adjustments:
    • Brightness
    • Contrast
    • Exposure
    • Opacity
    • Shadows
    • Highlights
    • Sharpness
  • Other tools:
    • Extract color palette
    • Extract dominant color

Project structure

  • demo/ - a collection of demo scripts of all features.
  • lib/ - rust code for functions in wasm.
  • src/core/ - all the functions for image editing.
  • src/editpix.js - main class of the library where all the functionality is grouped.
  • src/image-manager.js - image-related functions such as resizing and image-to-pixelArray conversion.
  • src/utils.js - utility functions shared between features.
  • test/ - Node unit tests using Jest.

Basic Usage

Here's a short tutorial / example on loading an image, performing simple edits, and then saving.

const editpix = new EditPix();

// image url
const url = "images/img.jpg";

// create image
var image = new Image();
image.src = url;

// waiting image load
image.onload = () => {
    // convert image to gray scale
    editpix.toGrayScale(image)
        .then(grayScaledImage => {
            // render original image
            document.body.appendChild(image);
            // render modified image
            document.body.appendChild(grayScaledImage);
        })
        .catch(error => { console.log(error) })
};

Contributing

We welcome contributions! Please follow our Code of Conduct and our Contributing guidelines.

Contributors

Contributors

Authors

License

This library is provided under the MIT license.