sparkfish / augraphy

Augmentation pipeline for rendering synthetic paper printing, faxing, scanning and copy machine processes
https://github.com/sparkfish/augraphy
MIT License
334 stars 43 forks source link

Add `InkColorSwap` to Replace the Color Used for Lettering in a Document #303

Closed jboarman closed 1 year ago

jboarman commented 1 year ago

Historical documents, as just one scenario, often have text that is faded or otherwise have low contrast compared to the background. Since it can be difficult to source documents that meet this criteria, we need an augmentation that can be used to render these scenarios.

Effect of InkColorSwap Augmentation

Reference Images

Note the effect of the red and black text in examples below. The examples illustrate these effects where (1) the red ink has a lower contrast than the black ink compared to the background color, (2) the red ink has faded more than the black over time, and (3) when converted to greyscale the red ink almost disappears since it lacks the color contrast to differentiate the ink from the ~paper~ papyrus.

Red / Black Ink (crisp, but low contrast compared to background)

image

Red Ink Faded More than Black Ink

image

Greyscale Version Illustrating Impact of Low Contrast Colors

image

kwcckw commented 1 year ago

This is now added in this pull request: https://github.com/sparkfish/augraphy/pull/305