프로젝트
GitHub에서 보기
mattdesl/image-sdf
소개
generate a signed distance field from an image
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalimage-sdf
Command-line tool which takes a 4-channel RGBA image and generates a signed distance field. The bitmask is determined by pixels with alpha over 128 and any RGB channel over 128.

# install the tool
npm install image-sdf -g
# apply the effect on an image
# and pipe it to a new file
image-sdf atlas.png --spread 32 --downscale 2 > atlas-sdf.png
The code has been adpated from libgdx.
PRs welcome. This could be split into more modules (generating a bit mask, computing SDF, better image support, etc).
Usage
image-sdf input.png [opt]
Options:
-o, --output output file
-s, --spread distance spread amount, default 1
-d, --downscale amount to downscale the output, default 1
-c, --color output color, accepts css strings, default #fff
-h Show help
Examples:
image-sdf input.png -c "rgb(128,255,20)" -s 10 -o output.png
image-sdf input.png --spread 2 --downscale 2 > output.png
image-sdf input.png --color black -o build/output.png
The programmatic API may evolve into their own modules, i.e. for custom bitmasks.
License
MIT, see LICENSE.md for details.
관련 프로젝트 살펴보기
불러오는 중…
