Created
June 15, 2012 16:27
-
-
Save supki/2937418 to your computer and use it in GitHub Desktop.
Simple screenshot folding via repa library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE UnicodeSyntax #-} | |
module Main where | |
import Control.Applicative ((<$>)) | |
import System.Directory (getDirectoryContents) | |
import System.FilePath ((</>)) | |
import Data.Array.Repa.IO.DevIL | |
import qualified Data.Array.Repa as R | |
main ∷ IO () | |
main = do | |
image_files ← map ("img" </>) . filter (`notElem` [".",".."]) <$> getDirectoryContents "img" | |
runIL $ do | |
images ← mapM readImage image_files | |
let xs = [R.transpose x | RGB x ← images] | |
z ← R.computeP $ R.transpose $ foldr1 (R.++) xs | |
writeImage "POLOTNISHE.png" $ RGB z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment