simple set of functions and cli for image manipulation
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Mahdi Dibaiee ffdf17c84e fix(resize): width and height were swapped accidentally :| 6 years ago
app feat(resize): resize/scale using nearest-neighbor 6 years ago
src fix(resize): width and height were swapped accidentally :| 6 years ago
test initial commit 7 years ago
.gitignore initial commit 7 years ago
45.png feat(embed): allow embedding of images into each other 6 years ago
LICENSE initial commit 7 years ago
README.md chore(readme): guide 6 years ago
Setup.hs initial commit 7 years ago
dreamboy.jpg initial commit 7 years ago
output.png example 7 years ago
picedit.cabal fix(resize): width and height were swapped accidentally :| 6 years ago
stack.yaml initial commit 7 years ago
test.png feat(embed): allow embedding of images into each other 6 years ago

README.md

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

Embedding images (the zombie is embedded at top left, 100x + 10y):

Library

Documentation available at hackage

import Data.Picture

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

  writePicturePng "output.png" (grayscale pic)