From 232b1291fa4923e8d25cd572aa25f4d3f63d871d Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Sat, 4 Feb 2017 12:16:48 +0330 Subject: [PATCH] fix(rotate): should use transparency instead of white pixels while rotating --- picedit.cabal | 2 +- src/Data/Picture.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/picedit.cabal b/picedit.cabal index 01e6774..0724312 100644 --- a/picedit.cabal +++ b/picedit.cabal @@ -1,5 +1,5 @@ name: picedit -version: 0.2.1.0 +version: 0.2.2.0 synopsis: simple image manipulation functions description: Simple set of functions for image manipulation: contrast, brightnesss, rotation, etc. homepage: https://github.com/mdibaiee/picedit#readme diff --git a/src/Data/Picture.hs b/src/Data/Picture.hs index 810779a..65a64ce 100644 --- a/src/Data/Picture.hs +++ b/src/Data/Picture.hs @@ -139,7 +139,7 @@ module Data.Picture ( Picture -- move them back to the origin movedIndices = map (\[x, y] -> [x + originX, y + originY]) rotatedIndices - f m = reshape (cols m) $ fromList $ map (\[x, y] -> if y < 0 || y >= rows r || x < 0 || x >= cols r then 255 else m `atIndex` (y, x)) movedIndices + f m = reshape (cols m) $ fromList $ map (\[x, y] -> if y < 0 || y >= rows r || x < 0 || x >= cols r then 0 else m `atIndex` (y, x)) movedIndices -- | Compress the image using SVD -- note: this is not size compression, it's just a k-rank approximation of the image