-
-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* actually use parameters given to PNG. * add colorType method to png type * basic setup * add actions * add verbose output * refactor a little bit * add easy util functions * add font loading * add font loading * add diff and distance * testing works * fix verbose mode * test log * test writing files * factor out test tools and test verbose mode * errorless should * unused imports * move load font into own file * move constants out of function * parse more arg types * add usage examples * add plugin loading * also load types * test plugin loading * this doesn't provide any more info than nothing * add readme and kinda fix types * unused deps * types broke * run cli tests with whole repo * lint * delete test image after test * add to main readme * fix custom link * more detailed custom docs * refactor to read * better actions handling a * way better help output and add create image * add bin * test blit * update readme * update license strategy
- Loading branch information
1 parent
aefcc84
commit 7bab953
Showing
33 changed files
with
1,107 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div align="center"> | ||
<a href="https://intuit.github.io/Ignite/"> | ||
<img width="200" height="200" | ||
src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png"> | ||
</a> | ||
<h1>@jimp/cli</h1> | ||
<p>jimp on the cli</p> | ||
</div> | ||
|
||
Jimp on the CLI. | ||
|
||
## Usage | ||
|
||
Run with `--help` to get help information. Further help by running `--help <command>`. The two main functions are `read` and `create`. | ||
|
||
```sh | ||
jimp <command> | ||
|
||
Commands: | ||
jimp read [img] Read and image into jimp. (PNG, JPEG, TIFF, BMP, or GIF) | ||
jimp create Create a new image | ||
jimp distance [img1] [img2] Calculates the hamming distance of two images based on their | ||
perceptual hash | ||
jimp diff [img1] [img2] Diffs two images | ||
jimp rgbaToInt A static helper method that converts RGBA values to a single | ||
integer value. args: r, g, b, a (0 - 255) | ||
jimp intToRGBA A static helper method that converts RGBA values to a single | ||
integer value. args: num (eg 0xFF0000FF) | ||
jimp cssColorToHex Converts a css color (Hex, 8-digit (RGBA) Hex, RGB, RGBA, HSL, | ||
HSLA, HSV, HSVA, Named) to a hex number | ||
jimp limit255 Limits a number to between 0 or 255. args: num | ||
jimp compareHashes Calculates the hamming distance of two images based on their | ||
perceptual hash. args: hash1, hash2 | ||
jimp colorDiff Compute color difference. args: color1, color2 ({r:val, g:val, | ||
b:val, a:val}) | ||
jimp measureText Measure how wide printing a string will be. args: text | ||
jimp measureTextHeight Measure how tall printing a string will be. args: text, width | ||
|
||
Jimp Configuration: | ||
--plugins, -p Jimp plugins to load. [array] | ||
--types, -t Jimp types to load. [array] | ||
--loadFont, -f Path of font to load and be used in text operations [string] | ||
|
||
Options: | ||
--help Show help [boolean] | ||
--version Show version number [boolean] | ||
--verbose, -v enable more logging [boolean] | ||
|
||
Examples: | ||
jimp read path/to/image.png --output output.jpg Convert images from one type to another. See | ||
more under jimp read --help | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../babel.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "@jimp/cli", | ||
"version": "0.4.0", | ||
"description": "jimp on the cli", | ||
"bin": { | ||
"jimp": "dist/index.js" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "es/index.js", | ||
"scripts": { | ||
"test": "mocha --require ts-node/register test/*.test.ts", | ||
"test:coverage": "nyc npm run test -- --require source-map-support/register --recursive", | ||
"build": "tsc", | ||
"build:debug": "npm run build -- --sourceMap", | ||
"build:watch": "npm run build -- --watch --sourceMap" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@jimp/custom": "^0.4.0", | ||
"chalk": "^2.4.1", | ||
"jimp": "^0.4.0", | ||
"log-symbols": "^2.2.0", | ||
"yargs": "^12.0.2" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"@types/log-symbols": "^2.0.0", | ||
"@types/mocha": "^5.2.5", | ||
"@types/yargs": "^11.1.1", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.0.3" | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
], | ||
"include": [ | ||
"src/*.ts" | ||
], | ||
"reporter": [ | ||
"html", | ||
"text" | ||
] | ||
}, | ||
"yargs": { | ||
"flatten-duplicate-arrays": false | ||
} | ||
} |
Oops, something went wrong.