The task
Given an image as input, your task is to do the following:
- Resize the image so it is At least 2 times smaller, but still has the same width/height ratio by taking every second (if resized to 2x) pixel in both horizontal and vertical directions and using those in the pixel art image. Example:
a 4x4 image
[abcd
,efgh
,ijkl
,mnop]
When resized to 2x will become one of the following:
[ac [bd [eg [fh
,ik] ,jl] ,mo] ,np]
- Each RGB pixel in the newly resized image must be converted to a 3-bit color, so there are 8 different possible colors:
Red (255,0,0)
Green (0,255,0)
Blue (0,0,255)
Light Blue (0,255,255)
Magenta (255,0,255)
Yellow (255,255,0)
White (255,255,255)
Black (0,0,0)
An image of the colors:
- And output the resulting image.
Input
Your input may be:
- An image
- A path to the inputting image
Output
Can be:
- An image
- A path to the outputting image
Rules
- The inputting image will not be larger than 2048x2048 and will always be at least 256x256
- The outputting image must be at least 64x64
- When changing pixels, the original pixel must be converted to the closest (euclidean) pixel in the 3-bit scheme, no randomization
- You may hardcode how much you resize the image if you want to
- When submitting your answer, please include the following:
- Your byte-count in the title
- Your code
- An pair of images, one original of your choice and the other being the "pixel-art" from that image
- This is code-golf, so lowest byte count for each language wins.