You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I tried to add a few image functions to a library of mine and decided to use your juicy pixels
(Which seems great). But I do not get the behaviour I expected from extractComponent. Ill illustrate in code:
loadBMP_DBG fp =
withFile fp ReadMode $ \handle -> do
bs <- BS.hGetContents handle
case decodeBitmap bs of
(Left str) -> error str
(Right (ImageRGB8 img)) ->
do
let red = extractComponent 0 img
green = extractComponent 1 img
blue = extractComponent 2 img
(Image _ _ vr) = red
(Image _ _ vg) = green
(Image _ _ vb) = blue
putStrLn $ show vr
putStrLn $ show vg
putStrLn $ show vb
The picture I use is attached, it is just an image filled with the same color (10,20,30). So I expected
that show vr would yield [10,10,10,...
and vg [20,20,20....
and vb [30,30,30...
instead i get [10,30,20,10,30,20.. for vb
and [20,10,30,20,10,30... for vg
and [30,20,10,30,20,10... for vb
The text was updated successfully, but these errors were encountered:
Reported by Joel Bo Svensson
Hi.
Today I tried to add a few image functions to a library of mine and decided to use your juicy pixels
(Which seems great). But I do not get the behaviour I expected from extractComponent. Ill illustrate in code:
The picture I use is attached, it is just an image filled with the same color (10,20,30). So I expected
that show vr would yield [10,10,10,...
and vg [20,20,20....
and vb [30,30,30...
instead i get [10,30,20,10,30,20.. for vb
and [20,10,30,20,10,30... for vg
and [30,20,10,30,20,10... for vb
The text was updated successfully, but these errors were encountered: