Haskell HIP:将过滤器应用于图像

I'm trying to add a filter to an image using the Haskell Image Processing package HIP, I was able to read and convert the image to type Image VS YCbCr Word8. Now, how do I convert from Image VS YCbCr Word8 to Border (Pixel cs e) or Pixel cs e? Im stil learning Haskell so please keep it simple. see code below :

addFilterJpg :: FilePath -> IO ()
addFilterJpg fc = do
    case validPath fc of 
        Left err -> putStrLn err
        Right img -> do
            case readImage img of
                Left err -> putStrLn err
                Right img -> do
                  -- convert img::(Image VS YCbCr Word8) to Border (Pixel cs e)
                  -- apply filter
                  -- save image
                  putStrLn "Convolution Filter"
评论