svelte-multitoneimage
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

Svelte Multitone Image

A simple image renderer to apply multitone effects for svelte. Demo page

Basic usage

<MultitoneImage src="{imageSource}" colors="{colorArray}" />

Props

src

This is the origin of the image, equivalent of the src attribute on an tag.

alt

The alt text for the generated image.

colors

An array of hex colors, the component will automatically parse both short and long hexcodes. Defaults to ['#000', '#fff'] resulting in a grayscale image.

exponent and amplitude

As a final step in the filter a gamma correction is passed on each channel, this correction is of the form:

gamma = amplitude * pow(channel, exponent) + offset

This gamma correction enhances the overall contrast in the image. A higher exponent will make the dark areas darker, while a higher amplitude brightens the lighter areas.

The offset in this component will always be 0.

Readme

Keywords

none

Package Sidebar

Install

npm i svelte-multitoneimage

Weekly Downloads

10

Version

2.0.2

License

MIT

Unpacked Size

300 kB

Total Files

10

Last publish

Collaborators

  • rainlife