EpdSetThresholdBW(EpdBwThreshold As EpdBwThreshold)
|
Parameter |
Description |
|
EpdBwThreshold |
Black/White luma threshold used when reducing RGB565 colors to the EPD palette. |
Sets the Black/White conversion threshold.
As covered in TftPixel(), any RGB565 color that doesn't exactly match one of the panel's core colors gets reduced to the closest one it can represent.
For the final Black-vs-White decision specifically, EpdMapColor() computes a luma score for the color — a perceptual-brightness estimate, weighted so green contributes the most and blue the least, matching how the human eye actually perceives brightness (this is why the formula isn't a simple average of R, G, and B).
EpdBwThreshold is the cutoff that score is compared against: at or above it, the color maps to White; below it, to Black.
The default, 2494, is exactly the midpoint of every possible luma value this formula can produce — an even 50/50 split between what counts as "light enough to be white" and "dark enough to be black." Raising the threshold makes fewer colors qualify as white (more of the image shifts toward black); lowering it has the opposite effect.
Since EPD panels can only ever represent a handful of colors, no single threshold is objectively correct for every image — where the best cutoff falls depends on the specific colors your content actually uses, and this setting exists so you can tune that balance for your own use case rather than being locked to an arbitrary fixed split.
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with HelpNDoc's built-in SEO