5 ms·
Just spitballing a high-level implementation: 1. Color correct for the CMYK printing process 2. Load image as a pixel matrix 3. Unwrap pixel matrix into a pi
by chaorace 3y ago
Just spitballing a high-level implementation:
1. Color correct for the CMYK printing process
2. Load image as a pixel matrix
3. Unwrap pixel matrix into a pixel vector
4. Convert the pixel vector to HSV representation
5. Group each pixel into a palette slot by plugging the H/S dimensions into K-means with 32 as the target (ignoring L for clustering to account for scanlines/flicker)
6. For each palette slot, calculate the "true" HSV value by taking the group's median H/S values and the mean V value
7. Convert HSV representation to 12-bit RGB colorspace
- chefandy 3y agoSure, it's easy to write out the steps like that, but the devil is in the details. It's not super difficult for a human eye to figure out where the original pixels aught to go, but you just can't take a photograph of a photograph of a screen that was half-toned and printed with an offset printer or whatever they used and grab a clean original pixel matrix out of it with color accurate to even other parts of the image. The closer you get, the mushier it gets. Reducing the resolution using a nearest neighbor or bicubic algorithm would give you a cleaner pixel representation, but it still require a lot of cleanup to get the kind of accuracy he was going for, and inaccuracies would be a lot harder to spot in that context. I've worked on image-processing software for some big digital archival projects, I'm a long-time digital artist, and was a graphic designer having worked in print media. I would set myself a good long chunk of time to get that right and doing it for one single image rather than a necessarily reproducible process would not be close to worth it.