Unless your image is already pre-processed, you'll need to use
some number of filters.
A reliable-ish method to getting reasonable results is to use
the "threshold-adaptive" with a large-ish blocksize (on the order of
the image size) as the only filter.
To use the invert filter, precede it with a binary-threshold
with max-value 255.
The transform performed by each filter uses OpenCV under the
hood. Rough documentation for each method can be found on their
website. For example, see the adaptive threshold documentation.