Then run through each pixel again, and set it to the closest matching value from your palette. Done!
Then run through each pixel again, and set it to the closest matching value from your palette. Done!
...but on the other hand, with a high enough quality photograph, and a low enough resolution original image... it sure seems possible.
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
The first pass might be off - I can imagine adjusting the grid size to skip the scan lines for more accuracy. But the final result will be very close with 5% of the work involved. The guy has spent a day and a half for a task that should take less than an hour at most.
Even non-fisheye lenses have some distortion, but look at how wacky the grid can appear here:
https://docs.nvidia.com/vpi/image-003.jpg
And it gets worse if you only see the grid, and don't know how it was cropped out of the photo it was taken from (if it was off-center).
But yeah, I think we're all on the same page that some entrepreneurial image processing expert could make fairly quick work of the problem.
Even if they were distorted by a fisheye lens, it should be easy to use something like Photoshop's "pinch" filter to create an undistorted image to work from.
https://live.staticflickr.com/65535/50926604693_1e6b65f13b_b...