4
\$\begingroup\$

When you resize an image down to a very small size, it looks very blocky when you scale the pixels back up individually.

original Starry Night scaled-down Starry Night

In extreme cases, as above, you can no longer reconstruct the original image, as too much information has been lost. Your task is to build a program that will imagine what the original, unscaled image might have looked like in extreme cases such as this one, where the picture has been reduced to a simple palette.

Your program will take an uncompressed bitmap image with three 8-bit RGB channels (with maximum dimensions 16 pixels on each side), and output a second image that produces the original image when scaled down using an average filter (equivalent to GIMP's "Linear" option).

The output image should have the same aspect ratio as the original and have an exact multiple of pixels, to make average-filtering easier. It should also be at least 50 times the size of the original image on each dimension.

\$\endgroup\$
  • 3
    \$\begingroup\$ What's stopping me from upscaling the input image 50 times? \$\endgroup\$ – Pavel Jan 9 '17 at 1:38
  • \$\begingroup\$ Personally, I like this idea, but my opinion is admittedly not representative of the community. Hopefully this doesn't get closed before I come up with something neat. \$\endgroup\$ – Patrick Roberts Jan 9 '17 at 1:39
  • \$\begingroup\$ @Pavel nothing. But I wouldn't upvote an answer that did that. \$\endgroup\$ – Patrick Roberts Jan 9 '17 at 1:40
  • 5
    \$\begingroup\$ This appears to be "do simple task in a creative way". That makes it likely to be considered too broad. \$\endgroup\$ – trichoplax Jan 9 '17 at 2:03
  • 3
    \$\begingroup\$ This question also lacks a validity criterion, and I agree with @trichoplax 's point. Also you did not specify how you get from the high res image to the low res one. Next time please read the tag description and post your challenge in the sandbox as advised here. \$\endgroup\$ – flawr Jan 9 '17 at 13:05