<commit_before>-- Implements Burkes Dithering algorithm

--     X 8 4
-- 2 4 8 4 2
--
--  (1/32)

local bitmap = dofile("../lib/bitmap.lua")

local ditherImage = bitmap.createBitmapFromFile("car.bmp")

local palette = {
	{24,   24,   24 },
	{29,   43,   82 },
	{126,  37,   83 },
	{0,    134,  81 },
	{171,  81,   54 },
	{86,   86,   86 },
	{157,  157,  157},
	{255,  0,    76 },
	{255,  163,  0  },
	{255,  240,  35 },
	{0,    231,  85 },
	{41,   173,  255},
	{130,  118,  156},
	{255,  119,  169},
	{254,  204,  169},
	{236,  236,  236}
}

local sqrt = math.sqrt
local function closestRGB(r, g, b)
  local error = math.huge --sqrt(255*255 + 255*255 + 255*255)
  local e1, e2, e3 = math.huge, math.huge, math.huge -- 255, 255, 255<commit_msg>oopsise<commit_after>-- Implements Burkes Dithering algorithm

--     X 8 4
-- 2 4 8 4 2
--
--  (1/32)

local bitmap = dofile("../lib/bitmap.lua")

local ditherImage = bitmap.createBitmapFromFile("astc.bmp")

local palette = {
	{24,   24,   24 },
	{29,   43,   82 },
	{126,  37,   83 },
	{0,    134,  81 },
	{171,  81,   54 },
	{86,   86,   86 },
	{157,  157,  157},
	{255,  0,    76 },
	{255,  163,  0  },
	{255,  240,  35 },
	{0,    231,  85 },
	{41,   173,  255},
	{130,  118,  156},
	{255,  119,  169},
	{254,  204,  169},
	{236,  236,  236}
}

local sqrt = math.sqrt
local function closestRGB(r, g, b)
  local error = math.huge --sqrt(255*255 + 255*255 + 255*255)
  local e1, e2, e3 = math.huge, math.huge, math.huge -- 255, 255, 255
{'fraction_non_alphanumeric': 0.19446320054017555, 'fraction_numerical': 0.21336934503713706, 'mean_word_length': 2.315436241610738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2937475', 'n_tokens_mistral': 882, 'n_tokens_neox': 677, 'n_words': 187}