                               bw <- imageTo32F i
                               return . Just . S  $ bw
 
-class Sized a where
-    type SizeT a :: *
-    getSize :: a -> SizeT a
-
-instance Sized BareImage where
-    type SizeT BareImage = (Int,Int)
+class IntSized a where
+    getSize :: a -> (Int,Int)
+
+instance IntSized BareImage where
    -- getSize :: (Integral a, Integral b) => Image c d -> (a,b)
     getSize image = unsafePerformIO $ withBareImage image $ \i -> do
                  w <- {#call getImageWidth#} i
                  h <- {#call getImageHeight#} i
                  return (fromIntegral w,fromIntegral h)
 
-instance Sized (Image c d) where
-    type SizeT (Image c d) = (Int,Int)
+instance IntSized (Image c d) where
     getSize = getSize . unS
 
 --loadColorImage n = do

subPixelBlit
  :: Image c d -> Image c d -> (CDouble, CDouble) -> IO ()

subPixelBlit (unS -> image1) (unS -> image2) (x,y) 
    | badSizes  = error $ "Bad blit sizes: " ++ show [(w1,h1),(w2,h2)]++"<-"++show (x,y) 
    | otherwise = withImage image1 $ \i1 ->
                   withImage image2 $ \i2 ->

getChannel no image = unsafePerformIO $ creatingImage $ do
    let (w,h) = getSize image
    setCOI no image
    cres <- {#call wrapCreateImage32F#} (fromIntegral w) (fromIntegral h) 1
    withGenImage image $ \cimage ->
      {#call cvCopy#} cimage (castPtr cres) (nullPtr)
    resetCOI image
