This is a quine variation.
Introduction
We all write short code, because some obscure reasons, but whatever we do, the'll take up at least 144 pixels/byte (with a 12px font). But what would happen, if we would encode our code in images? This is your task today.
Challenge
You task is to read in your own source code (non-proper quines are allowed, e.g. literally reading the source file), and create an image out of it, by setting the red, green and blue components of a pixel based on the ASCII value of the character.
Example:
We have the string "Hello world!"
Hello world!
Let's convert this to ASCII values:
72 101 108 108 111 32 119 111 114 108 100 33
Map the RGB values to it (If the source code's length is not divisible by 3, use 0s as the remaining characters):
__________________________________________________
| R | G | B || R | G | B || R | G | B || R | G | B |
----------------------------------------------------
|72 |101|108||108|111|32 ||119|111|114||108|100|33 |
----------------------------------------------------
We then create the image with the smallest area out of it. We have 4 sets of RGB values, so the smallest image will be a 2*2 image, going from the top left pixel to the right:
And we get this awfully colored image (resized, so it's at least visible, also proves the fact how small it can get)
Rules/Additional information
- There's no input
- The output should be as a separate file, or in a separate window.
- For multibyte characters, split the character in 2 bytes.
- The source code must be at least 1 byte long
- The image should be the one from the possible sizes, wich has the closest width/height ratio to 1
- The pixel count on the image should exactly be ceil(byte count / 3), no extra pixels should be added
Scoring
This is a code-golf, so the smallest answer in bytes wins.
height = N
andwidth = 1
? I think you mean width/height closest to 1. \$\endgroup\$