Image editor: the JavaScript library
Data and helpers of the image editor: color palette, shapes, color conversion and named colors in 29 languages.
@openlibsdev/image-editor- v1.0.0
- ES module
- MIT
Installation
With a bundler or Node-style imports:
npm install @openlibsdev/image-editorimport ImageEditor from "@openlibsdev/image-editor";Or straight in a page, without a build step (jsDelivr resolves the dependencies):
<script type="module">
import ImageEditor from "https://cdn.jsdelivr.net/npm/@openlibsdev/image-editor@1.0.0/+esm";
</script>Usage
import ImageEditor from "@openlibsdev/image-editor";
console.log(ImageEditor.toHex("rgb(13, 110, 253)")); // "#0d6efd"
console.log(ImageEditor.hexA("#0d6efd", 0.5));
const color = await ImageEditor.findNamedColor("dark blue", "en");API
ImageEditor.toHex(c)
Any CSS color → #rrggbb.
ImageEditor.hexA(hex, a)
Color with transparency.
ImageEditor.PALETTE
Default palette.
ImageEditor.SHAPES
Shapes.
ImageEditor.starPoints()
Points of a star shape.
ImageEditor.findNamedColor(text, lang)
Finds a named color by its name in the given language ("dark blue" → #00008b).
ImageEditor.listNamedColors(lang)
Lists the named colors with their names in the given language.
ImageEditor.EXTRA
Names of the object properties saved with a project besides the standard ones (name, lock, id, blend mode).
ImageEditor.LBL
Default layer names by object type (rectangle, ellipse, text, image, group, …).
ImageEditor.namedColorTexts(lang)
Labels of the color field in the given language (the texts of the color picker), English for a missing language.
ImageEditor.textFontData
Data for a text and font block: the font list, loading a font style, adding a font file, the block's labels in a language and the default values.
ImageEditor.APP
Name and version of the library: {name, version}.
Dependencies
What the library loads, with the licenses (all are listed on the Licenses page).
| Name | Version | License | Files |
|---|---|---|---|
| @openlibsdev/font-forge | 1.0.0 | MIT | GitHub |
| @openlibsdev/image-forge | 1.0.0 | MIT | GitHub |
| @imagemagick/magick-wasm | 0.0.35 | Apache-2.0 | License · Source code |
| @imagemagick/magick-wasm | 0.0.35 | Apache-2.0 | License · Source code |
| @simonwep/pickr | 1.10.2 | MIT | License · Source code |
| @simonwep/pickr | 1.10.2 | MIT | License · Source code |
| dejavu-fonts-ttf | 2.37.3 | Bitstream Vera Fonts License (free, redistributable); DejaVu changes are public domain | License · Source code |
| fabric | 5.3.0 | MIT | License · Source code |
| imagetracerjs | 1.2.6 | Unlicense | License · Source code |
| jspdf | 2.5.2 | MIT | License · Source code |