picedit/README.md

51 lines
1.5 KiB
Markdown
Raw Normal View History

2016-10-08 12:16:25 +00:00
picedit
=======
A simple CLI and API for image manipulation
CLI Usage
---------
```
Usage: picedit <input> [OPTIONS]
Options:
--contrast <n> - a number between -255 and 255
--brightness <n> - a number between -255 and 255
--gamma <n>
--fade <n> - a number between 0 and 100
--rotate <n> - rotate image by n degrees
--grayscale - turn the image grayscale
--invert - invert (negative) the image
--compress <n> - approximate the (width - n)-th rank of image using SVD
a number between 0 (no compression) and image width (full compression)
note: this is not size compression
2016-10-08 12:16:25 +00:00
--output <filename> - output name, defaults to 'output.png'
```
2016-10-08 13:16:43 +00:00
Example:
```
stack exec picedit -- dreamboy.jpg --grayscale --contrast 180 --gamma 2 --rotate 180
```
2016-10-08 13:17:49 +00:00
<img width='45%' src='https://github.com/mdibaiee/picedit/blob/master/dreamboy.jpg?raw=true' />
2016-10-08 13:18:19 +00:00
<img width='45%' src='https://github.com/mdibaiee/picedit/blob/master/output.png?raw=true' />
2016-10-08 13:16:43 +00:00
2017-02-02 20:18:35 +00:00
Embedding images:
2017-02-02 20:20:04 +00:00
<img width='5%' src='https://github.com/mdibaiee/picedit/blob/master/45.png?raw=true' />
<img width='40%' src='https://github.com/mdibaiee/picedit/blob/master/output.png?raw=true' />
<img width='40%' src='https://github.com/mdibaiee/picedit/blob/master/test.png?raw=true' />
2017-02-02 20:18:35 +00:00
2016-10-08 12:16:25 +00:00
Library
-------
2016-10-08 13:07:37 +00:00
[Documentation available at hackage](https://hackage.haskell.org/package/picedit-0.1.0.0/docs/Data-Picture.html)
2016-10-08 12:16:25 +00:00
```haskell
import Data.Picture
2016-10-08 12:16:25 +00:00
main = do
pic <- readPicture "myfile.png"
writePicturePng "output.png" (grayscale pic)
```