simple set of functions and cli for image manipulation
Go to file
2016-11-04 09:50:03 +03:30
app feat(compress): SVD approximation of image 2016-10-08 18:14:47 +03:30
src feat(compress): SVD approximation of image 2016-10-08 18:14:47 +03:30
test initial commit 2016-10-08 15:43:02 +03:30
.gitignore initial commit 2016-10-08 15:43:02 +03:30
dreamboy.jpg initial commit 2016-10-08 15:43:02 +03:30
LICENSE initial commit 2016-10-08 15:43:02 +03:30
output.png example 2016-10-08 16:46:43 +03:30
picedit.cabal chore(hmatrix): compatible with hmatrix 0.18 2016-11-04 09:50:03 +03:30
README.md feat(compress): SVD approximation of image 2016-10-08 18:14:47 +03:30
Setup.hs initial commit 2016-10-08 15:43:02 +03:30
stack.yaml initial commit 2016-10-08 15:43:02 +03:30

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
  --output <filename> - output name, defaults to 'output.png'

Example:

stack exec picedit -- dreamboy.jpg --grayscale --contrast 180 --gamma 2 --rotate 180

Library

Documentation available at hackage

import Data.Picture

main = do
  pic <- readPicture "myfile.png"

  writePicturePng "output.png" (grayscale pic)