                                          s <- {#get IplImage->widthStep#} c_i
                                          let cs = fromIntegral s
                                              fs = sizeOf (undefined :: Float)
-                                         r <- peek (castPtr (d`plusPtr` (y*cs +x*3*fs)))
-                                         g <- peek (castPtr (d`plusPtr` (y*cs +(x*3+1)*fs)))
+                                         l <- peek (castPtr (d`plusPtr` (y*cs +x*3*fs)))
+                                         a <- peek (castPtr (d`plusPtr` (y*cs +(x*3+1)*fs)))
                                          b <- peek (castPtr (d`plusPtr` (y*cs +(x*3+2)*fs)))
-                                         return (r,g,b)
-
-getPixelOldRGB (fromIntegral -> x, fromIntegral -> y) image
-        = unsafePerformIO $ do
-                     withGenImage image $ \img -> do
-                              r <- {#call wrapGet32F2DC#} img y x 0
-                              g <- {#call wrapGet32F2DC#} img y x 1
-                              b <- {#call wrapGet32F2DC#} img y x 2
-                              return (realToFrac r,realToFrac g, realToFrac b)
+                                         return (l,a,b)
 
 -- | Perform (a destructive) inplace map of the image. This should be wrapped inside
 -- withClone or an image operation

                             poke (castPtr (d`plusPtr` (y*(fromIntegral s)
                                  + x*sizeOf (0::Word8))):: Ptr Word8)
                                  v

instance SetPixel (Image DFT D32) where
    type SP (Image DFT D32) = Complex D32

                   poke (castPtr (d `plusPtr` (y*cs+x*fs))) (f v)




convertTo :: CInt -> CInt -> BareImage -> BareImage
