Created
June 15, 2012 15:27
-
-
Save supki/2937031 to your computer and use it in GitHub Desktop.
Simple screenshot folding via gd 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 Data.List (foldr1) | |
import Graphics.GD (copyRegion, loadPngFile, newImage, savePngFile) | |
import System.Directory (getCurrentDirectory, getDirectoryContents) | |
import System.FilePath ((</>)) | |
main ∷ IO () | |
main = do | |
image_files ← map ("img" </>) . filter (`notElem` [".",".."]) <$> getDirectoryContents "img" | |
images ← mapM loadPngFile image_files | |
new_image ← newImage (1366 * length images, 768) | |
mapM (\(i,s) → copyRegion (0,0) (1366,768) s (1366 * i,0) new_image) $ zip [0..] images | |
savePngFile "POLOTNISHE.png" new_image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
meemoh