in = do
  a <- getArgs
  f <- Bl.readFile $ head a
  let file = Bl.unpack f
  let fileHeader = dropTake 0 14 file
  let infoHeader = dropTake 14 40 file
  --let color = dropTake 54 0 file
  let imgData = drop 54 file

  --print fileHeader
  --print infoHeader

  let xsize = rsInt (head $ dropTake 4 4 infoHeader)

  --let xsize = 4

  --print $ takeBGR xsize imgData

  --let readData = Bl.pack $ fileHeader ++ infoHeader ++ imgData

  let readData = Bl.pack $ fileHeader ++ infoHeader ++ (cfold $ map cfold $ (map (map bgr2Red) ) $ takeBGR xsize imgData) 

  Bl.writeFile (( (init . init . init . init) (head a) )++ "read.bmp") readData
main = do
  a <- getArgs
  f <- Bl.readFile $ head a
  let file = Bl.unpack f
  let fileHeader = dropTake 0 14 file
  let infoHeader = dropTake 14 40 file
  --let color = dropTake 54 0 file
  let imgData = drop 54 file

  --print fileHeader
  --print infoHeader

  let xsize = rsInt (head $ dropTake 4 4 infoHeader)

  --let xsize = 4

  --print $ takeBGR xsize imgData

  --let readData = Bl.pack $ fileHeader ++ infoHeader ++ imgData

  let readData = Bl.pack $ fileHeader ++ infoHeader ++ (cfold $ map cfold $ (map (map bgr2Red) ) $ takeBGR xsize imgData) 

  Bl.writeFile (( (init . init . init . init) (head a) )++ "read.bmp") readData
main = do
  a <- getArgs
  f <- Bl.readFile $ head a
  let file = Bl.unpack f
  let fileHeader = dropTake 0 14 file
  let infoHeader = dropTake 14 40 file
  --let color = dropTake 54 0 file
  let imgData = drop 54 file

  --print fileHeader
  --print infoHeader

  let xsize = rsInt (head $ dropTake 4 4 infoHeader)

  --let xsize = 4

  --print $ takeBGR xsize imgData

  --let readData = Bl.pack $ fileHeader ++ infoHeader ++ imgData

  let readData = Bl.pack $ fileHeader ++ infoHeader ++ (cfold $ map cfold $ (map (map bgr2Red) ) $ takeBGR xsize imgData) 

  Bl.writeFile (( (init . init . init . init) (head a) )++ "read.bmp") readData