Guest User

Untitled

a guest
Oct 20th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. {-# LANGUAGE UnicodeSyntax #-}
  2. module Main where
  3.  
  4. import Control.Applicative ((<$>))
  5. import Data.List (foldr1)
  6. import Graphics.GD (copyRegion, loadPngFile, newImage, savePngFile)
  7. import System.Directory (getCurrentDirectory, getDirectoryContents)
  8. import System.FilePath ((</>))
  9.  
  10. main ∷ IO ()
  11. main = do
  12. image_files ← map ("img" </>) . filter (`notElem` [".",".."]) <$> getDirectoryContents "img"
  13. images ← mapM loadPngFile image_files
  14. new_image ← newImage (1366 * length images, 768)
  15. mapM (\(i,s) → copyRegion (0,0) (1366,768) s (1366 * i,0) new_image) $ zip [0..] images
  16. savePngFile "POLOTNISHE.png" new_image
Add Comment
Please, Sign In to add comment