Created
December 23, 2018 04:28
-
-
Save ion1/921c915891e0e243edf9a77a75bb5047 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = average [im0, im1] ++ mask; | |
[im0, im1] = map (\p extract_bands 0 3 (Image_file p)) | |
[ "5.0 Knights of the Eternal Throne.jpg" | |
, "5.10 Jedi Under Siege.jpg" | |
]; | |
mask = 255 - min_pair 255 (20 * average diff_bands); | |
diff_bands = bands (on my_diff (colour_transform_to Image_type.sRGB) im0 im1) | |
++ bands (on my_diff (colour_transform_to Image_type.LAB) im0 im1); | |
bands im = map scale (map (subscript im) [0 .. get_bands im-1]); | |
average xs = sum xs / len xs; | |
my_diff ima imb = max_pair (abs (ima - imb) - 10) 0; | |
on f g a b = f (g a) (g b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment