hi,
I extract black on white pages from PDF and feed into image occlusion enhanced.
the white backgrounds are killing my eyes.
googled and found this post:
that code allow image black white invertion.
with gpt4,
I 1st ask for a button to toggle it.
2nd i asked for a hardcoding into the note type.
so now with the following code,
you can hardcode into the notetype whether you want it all black by default or all white (forgive my political correctness),
and you can toggle with a button e.g. when you are reading a photo that need truth in color.
gpt4 is hard to help a layman to create a completely new thing,
but it’s a very powerful tool to let part-time-guy to modify existing thing.
<script>
const defaultInverted = true;
window.onload = function() {
var images = document.querySelectorAll('img');
images.forEach(img => {
img.style.filter = defaultInverted ? 'invert(1)' : 'none';
});
};
document.addEventListener('keydown', function(event) {
if (event.key === 'l') { // Change 'i' to your preferred toggle key
var images = document.querySelectorAll('img');
images.forEach(img => {
img.style.filter = img.style.filter === 'invert(1)' ? 'none' : 'invert(1)';
});
}
});
</script>