1.1.0 • Published 1 year ago

shadowizer v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Usage

See shadowizer --help for more details.

shadowizer root

Find images and add box shadow to them. You can specify the root directory, which can be an absolute path, or a path relative to the current working directory. Default to process.cwd().

It should be noted that all images with added shadows will be output in png format to the shadowizer-{timestamp} directory in the root directory.

Why not other output formats such as jpeg, because png supports transparency.

OptionsDescription
-f, --filesspecify png images, support glob patterns, default: *.{png,jpg,jpeg,webp}
-c, --shadowColorset shadow color, default: #00000073
-b, --shadowBlurset shadow blur, default: 25
-x, --shadowOffsetXset shadow offset x, default: 0
-y, --shadowOffsetYset shadow offset y, default: 0

Example:

# specify directory to find png images
shadowizer path/to

# specify multiple images
shadowizer -f text.png -f fun.png

# specify images with glob patterns
shadowizer -f *.png

# set shadow color
shadowizer -c #00000073

API

addShadow

  • type: (imagePath: string, shadow?: ShadowOptions) => Promise<void | Buffer>

Adds a box shadow to the specified image.

import { addShadow } from 'shadowizer'

saveShadowImage

  • type: (imagePath: string, outDir?: string, shadow?: ShadowOptions) => Promise<boolean>

Adds a box shadow to the specified image and saves it to disk.

import { saveShadowImage } from 'shadowizer'

License

MIT © alex.wei

1.1.0

1 year ago

1.0.0

1 year ago