Twinside / Juicy.Pixels

Haskell library to load & save pictures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

instance ColorConvertible PixelYA8 PixelRGB8 loses data

nomeata opened this issue · comments

According to the docs, promotePixel should not lose any data, but yet

instance ColorConvertible PixelYA8 PixelRGB8 where
    {-# INLINE promotePixel #-}
    promotePixel (PixelYA8 y _) = PixelRGB8 y y y

Maybe the instance should receive a haddock comment warning about this, or the docs of promotePixel should indicate that alpha channel information can be lost.

Clearly inconsistent, I'd like to remove the instance, but bumping the major version number for this tiny case bug me a little.

There is a need to think about it.

I actually make use of the instance now... but I can work around its removal.

I also found myself abusing it in the test cases, but i guess adding a deprecated pragma is way to go with a bump of the documentation