- type Image = ForeignPtr GDImage
- type Size = (Int, Int)
- type Point = (Int, Int)
- type Color = CInt
- newImage :: Size -> IO Image
- copyImage :: Image -> IO Image
- loadJpegFile :: FilePath -> IO Image
- loadJpegData :: Int -> Ptr a -> IO Image
- loadPngFile :: FilePath -> IO Image
- loadPngData :: Int -> Ptr a -> IO Image
- loadGifFile :: FilePath -> IO Image
- loadGifData :: Int -> Ptr a -> IO Image
- saveJpegFile :: Int -> FilePath -> Image -> IO ()
- savePngFile :: FilePath -> Image -> IO ()
- saveGifFile :: FilePath -> Image -> IO ()
- imageSize :: Image -> IO (Int, Int)
- resizeImage :: Int -> Int -> Image -> IO Image
- rotateImage :: Int -> Image -> IO Image
- fillImage :: Color -> Image -> IO ()
- drawFilledRectangle :: Point -> Point -> Color -> Image -> IO ()
- drawFilledEllipse :: Point -> Size -> Color -> Image -> IO ()
- antiAliased :: (Color -> Image -> IO a) -> Color -> Image -> IO a
- rgb :: Int -> Int -> Int -> Color
- rgba :: Int -> Int -> Int -> Int -> Color
Types
type Image = ForeignPtr GDImageSource
Creating and copying images
Loading images
JPEG
loadJpegFile :: FilePath -> IO ImageSource
Load a JPEG image from a file.
Load a JPEG image from a buffer.
PNG
loadPngFile :: FilePath -> IO ImageSource
Load a PNG image from a file.
Load a PNG image from a buffer.
GIF
loadGifFile :: FilePath -> IO ImageSource
Load a GIF image from a file.
Load a GIF image from a buffer.
Saving images
JPEG
Save an image as a JPEG file.
PNG
GIF
Getting image information
Manipulating images
Resize an image to a give size.
Rotate an image by a multiple of 90 degrees counter-clockwise.
Drawing
antiAliased :: (Color -> Image -> IO a) -> Color -> Image -> IO aSource
Use anti-aliasing when performing the given drawing function. This can cause a segault with some gd versions.