ChatGPT wrote a Python tool to remove yellow backgrounds from PDFs

ChatGPT wrote a Python tool to remove yellow backgrounds from PDFs — Latest news
Source: Latest news

My wife, Denise, started singing with her church choir and needed to practice songs printed in booklets on yellow paper. She wanted to scan them to PDF, remove the yellow background and enlarge them for easier reading without wasting color ink. She also planned to use PlayScore 2 to play the sheet music and was worried the app might not handle the background color.

Photoshop proved too fiddly because each image needed slightly different adjustments. My wife was also uneasy about giving her music to ChatGPT directly; she didn't want the notes or words changed. Because AI can be non-deterministic—producing different results from the same input—I wanted a strictly deterministic solution.

I asked ChatGPT to generate a Python script that sets any non-gray or non-black pixels to white, allows slightly tinted grays, and handles multi-page PDFs.

chatgpt, python script, yellow background, pdfs, sheet music, playscore 2, photoshop, deterministic, grayscale, scan