From d3cd5b0148d64ae0f6e288e69b09acfe639fdcce Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 12 Jul 2009 07:21:52 +0200 Subject: Merge glyph and outline bitmap better Use a different threshold for merging the outline and glyph and also adjust the merge amount. This fails to give complete transparency (and thus will yield slightly darker looking glyphs, usually), but avoids very ugly looking artefacts at the edge between border and glyph that were still prevalent. --- libass/ass_bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 1e9603b..3642be8 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -261,7 +261,7 @@ static bitmap_t *fix_outline_and_shadow(bitmap_t *bm_g, bitmap_t *bm_o) unsigned char c_g, c_o; c_g = g[x]; c_o = o[x]; - o[x] = (c_o > c_g) ? c_o - (c_g / 2) : 0; + o[x] = (c_o > (3 * c_g) / 5) ? c_o - (3 * c_g) / 5 : 0; s[x] = (c_o < 0xFF - c_g) ? c_o + c_g : 0xFF; } g += bm_g->w; -- cgit v1.2.3