An open API service indexing awesome lists of open source software.

https://github.com/kjbrum/kraken-cli

Optimize images with the Kraken.io API.
https://github.com/kjbrum/kraken-cli

Last synced: 13 days ago
JSON representation

Optimize images with the Kraken.io API.

Awesome Lists containing this project

README

        

# Kraken CLI

> Optimize images with the Kraken.io API.

## Dependencies

- [jq](https://stedolan.github.io/jq) - Used to parse JSON responses.

## Install

```
$ curl https://raw.githubusercontent.com/kjbrum/kraken-cli/master/kraken > ~/bin/kraken
$ chmod +x ~/bin/kraken
```

## Usage

```
Kraken CLI

Optimize images with the Kraken.io API.

Usage:
$ kraken

Options:
--callback= Callback URL for posting the response to
--convert= Convert your image to a different format
- https://kraken.io/docs/image-type-conversion
--dev Enable developer mode (false)
--file= Path to the file to upload and optimize
--folder= Path to the folder of images to upload and optimize
--help Display the help text
--lossy Enable lossy optimization (false)
--meta= Preserve metadata of the image (profile|date|copyright|geotag|orientation)
--orient Enable lossless rotation of the image (false)
--quality= Quality of the optimized image (1-100)
--resize= Resize or generate multiple sizes of the given image
- https://kraken.io/docs/image-resizing
- https://kraken.io/docs/generating-image-sets
--sampling= Set a custom chroma subsampling for the optimization (4:2:0|4:2:2|4:4:4)
--status Query your account status
--url= URL of the image you want to optimize
--webp Enable returning WebP format (false)

Example:
$ kraken --url=http://example.com/image.jpg --lossy --convert='{"format": "jpg", "background": "#ff0000"}'
$ kraken --url=http://example.com/image.jpg --meta='["profile", "date"]'
$ kraken --file=path/to/image.jpg --resize='{"size": 150, "strategy": "square"}'
$ kraken --folder=path/to/folder --lossy --quality=50 --webp
```

## Config

[Find/create your API credentials here.](https://kraken.io/account/api-credentials)

##### KRAKEN_KEY

Your Kraken.io API key.

##### KRAKEN_SECRET

Your Kraken.io API secret.

## License

Copyright © [Kyle Brumm](http://kylebrumm.com). Free to use on whatever and may be redistributed under the terms specified in the [license](LICENSE.md).