Algorithm to turn gray-scale text into legible binary black and white text

I have an image with gray-scale anti-aliased text produced by Chromium and need to convert this into pure binary black and white text. Applying a simple binary threshold pass over the image causes artifacts, either missing edges or weird protrusions and text being too bold depending on the chosen threshold.

Below an example of the input, the perfect outcome (as this is how the text would be rendered without AA) and the current outcome based on binary threshold (I think this is a 0.6 threshold). Sadly, it’s not possible to instruct Chromium to render the text without anti-aliasing, so a conversion is the only option.

I was wondering if there was an established algorithm for this kind of problem or in what direction I would have to look to find something that could be adapted to work here. Any algorithm would need to be able to run in semi-realtime, no offline solutions.

text rendering example

troubleshooting – Why do pictures turn out dark when I shoot with my external flash?

update 2 years(ish) later: please help
so i tried this, i took photos with different shutter speeds. I was shooting manual for all photos with f1.8, iso of 200, white balance: Flash, my first shot was 1/200(max i can shoot with flash on) and my camera(or photos) did NOT pick up the flash and so with 1/160, 1/125, 1/100, 1/80, 1/60, 1/50, 1/40, 1/30, 1/25, 1/20, 1/25, 1/13, 1/10, 1/8 …. but anything solwer than 1/8 i was able to see flash on my photos ( 1/6, 1/5, 1/4, 0″3, 0″4…etc) is there anything that I’m missing in flash photography, now i know that sppedsync is important with the camera’s shutter and the flash itself. but I’m sure there is a way to shoot at 1/200 with flash. just to clarify again, the flash does fire in all the photos i took but anything faster than 1/8, you wont get your photo lit at all. i will provide the images for 1/8vs 1/6 and just know that in in both images i was able to see the flash firing with my eyes
enter image description here
enter image description here

I’ve tried many things: I’ve changed the flash’s batteries and also the camera’s batteries, none of them seem the problem. I’m using a Canon t3i and sunpak digiflash 3000. I’ve tried the internal camera flash and the pics turned out well, but when I connect the sunpak flash and turn it on the image is dark – darker than when there is no flash on at all.

I’ve tried to take a picture in the mirror while the external flash is on. The flash fired off, but in the picture the flash seems to have no light at all. I’m thinking that the problem should be somewhere between the camera and flash the spot where they connect. Please help I want this problem fixed.

dnd 5e – Do legendary actions trigger effects that happen at the beginning of the monster’s turn?

Consider this scenario. The monster is standing in the area of the cleric’s spirit guardians. As written, the monster takes damage at the beginning of its turn as long as it’s standing in the field. Suppose, however, that the monster takes a legendary action before its turn in initiative order. Does this trigger the effect of the spirit guardians, in addition to the normal trigger that would happen at the beginning of its regular turn? My ruling on the matter during the game was that it did not… This would seem to violate the whole purpose of legendary actions, resulting in a massive debuff of the monster (i.e. taking double spirit guardian damage simply because it took another turn in the initiative order).

Turn off DisableRootAutoUpdate cause a massive RAM usage of Lsass.exe on Windows Server 2008 R2

Today I’m encounter a stranger behavior on a Windows Server 2008 R2.

The key HKEY_LOCAL_MACHINESoftwarePoliciesMicrosoftSystemCertificatesAuthRootDisableRootAutoUpdate has been set to 1 for a long time. A few days ago, I set it to 0 to turn it off and I don’t take care much about it.

Today, I realized that my RAM usage go to 99% and it caused by lsass.exe (40 GB ram used by LSASS.exe and it’s not stop increasing)

I do a restart and the issue occur again.

To find out what happened, I go to Event Viewer and I found a tons of events 5058 , it raise up every new second:


  • Provider

    ( Name) Microsoft-Windows-Security-Auditing
    EventID 5061
    Version 0
    Level 0
    Task 12290
    Opcode 0
    Keywords 0x8020000000000000

  • TimeCreated

    ( SystemTime) 2020-05-30T16:52:23.419928300Z
    EventRecordID 231851935

  • Execution

    ( ProcessID) 644 ( ThreadID) 720
    Channel Security

    SubjectUserSid ………… SubjectUserName Administrator
    SubjectDomainName ……… SubjectLogonId 0x70e64 ProviderName
    Microsoft Software Key Storage Provider AlgorithmName RSA KeyName
    {00D5BCCB-6342-44D9-8964-F3731B2836E3} KeyType %%2499 Operation
    %%2480 ReturnCode 0x0

On the application logs, i found some event 4107, CAPI2:

Failed extract of third-party root list from auto update cab at:
with error: A certificate chain processed, but terminated in a root
certificate which is not trusted by the trust provider. .

After set the key DisableRootAutoUpdate back to 1, this issue gone.

Anyone know why it happened?

wireless – Kali: When I turn my laptop integrated WiFi card off it also turns my USB WiFI adapter off

I ask this because I want to use the USB adapter with Kali in VirtualbBox but it doesn’t get detected. I can connect to it on Linux but whenever I turn the integrated wireless card off it also turns the USB adapter off, like they’re sharing it, which is very weird as it never happened to me before.

dnd 5e – Why can’t you cast 2 leveled spells per turn

So I was just informed by my DM that I couldn’t cast cure Wounds and Healing Word in the same turn he. Then showed me why in the bonus action word textbox and I was wondering why can’t you cast 2 leveled spells. If one is a bonus action and ones an action what’s the flavor reason.

combat – Attack Range to Movement per Turn Ratio; Dunnigan’s Ratio?

What is the less-obscure replacement to the term ‘Dunnigan’s Ratio’ – the range of ratios of weapon ranges to typical distances moved in a single combat turn that produce tactically interesting gameplay (in the context of designing combat systems)?

In the context of seeking ways of ensuring interesting manoeuvring tactics in a combat system of an RPG, I have lately become rather confident that the ratio of weapon ranges should not be too high compared to distance travelled during a typical turn, as I witnessed long ranges often lead to combats having a positionally static feel (e.g. futuristic high-precision weapons combined with one-second combat turns).

Recently I’ve seen a post claiming

For an enjoyable game experience (…) A weapon range should never be more than 5-8× the maximum single turn movement of a unit.

and calling that the Dunnigan Ratio. Some questioning didn’t reveal much, other than attributing the observation to Jim Dunnigan, and usage to people who knew Dunnigan first-hand.

I tried feeding the term and a few variations of the phrase to a search engine, and none of the results (not even the excerpts of Jim’s books about designing combat games) seemed to be dealing with that specific topic. Which is unfortunate, as I’d like to learn more on the matter in question.

I have to conclude that this specific way of referring to the topic is not as commonly accepted in designer circles, and thus I would have better luck with using a term other people use and recognise (both for the purposes of searching for materials on the topic, and for clearly and concisely referring to it if I get lucky enough to get into live discussions related to it). What would this better alternative be?