Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# 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
Add Comment
Please, Sign In to add comment