# A weird screensaver

As I was gazing at my beautiful Puzzling.SE profile for a while, my screensaver started. But, contrary to what I expected, a completely unknown one appeared. Here is a short GIF of it:

There are three shapes that appear alternating and move around the screen for a while:

1. A jigsaw puzzling piece (200x280)
2. A StackExchange logo (120x150)
3. An arrow pointing upwards (200x200)

The borders of each of them are outlined with a solid black line, but the inner colors seem to be dependent on the underlying color on the screen at that specific pixel. If you can't view the GIF, here are example images: Jigsaw Piece, StackExchange Logo, Arrow.

Here are lists of some instances for each shape in the format shapeX,shapeY; pixelX,pixelY; pixelRed,pixelGreen,pixelBlue; convertedPixelRed,convertedPixelGreen,convertedPixelBlue, where the color values range from [0-255] and the used coordinate system is a screen coordinate system (shapeX,shapeY is also the upper left point of the rectangular bounds of each shape).

Jigsaw

988,302; 1129,565; 240,240,240; 240,48,176
627,365; 677,487; 255,255,255; 255,243,219
598,370; 654,510; 111,116,116; 111,228,196
592,371; 783,456; 221,255,255; 221,243,219
545,380; 623,422; 111,116,118; 111,228,14
444,397; 498,520; 255,255,255; 255,243,219
403,405; 472,618; 122,186,168; 122,114,72
403,405; 529,413; 231,232,234; 231,200,210
391,407; 434,649; 114,186,169; 114,114,109
373,410; 448,655; 112,186,170; 112,114,146
196,441; 301,587; 131,186,167; 131,114,35
184,443; 310,701; 100,186,171; 100,114,183
160,447; 181,536; 145,186,165; 145,114,217
143,451; 204,714; 102,189,175; 102,153,75
143,451; 208,587; 131,186,167; 131,114,35
143,451; 230,518; 149,186,164; 149,114,180
137,452; 276,563; 137,186,166; 137,114,254


Logo

118,167; 180,178; 45,46,41; 193,176,137
125,194; 176,303; 210,209,177; 218,232,17
145,268; 247,318; 208,207,178; 112,133,246
151,291; 180,392; 183,186,159; 84,74,90
152,295; 257,405; 180,186,159; 156,190,109
158,318; 170,426; 174,186,160; 168,74,192
162,333; 186,352; 195,194,165; 228,146,190
193,449; 305,532; 146,186,164; 118,190,172
204,488; 301,496; 155,186,163; 241,190,57
219,546; 295,585; 131,186,167; 175,144,71
102,107; 125,123; 246,246,246; 8,230,4
105,119; 126,222; 234,233,197; 120,145,126
110,138; 210,156; 46,47,42; 202,165,222
114,154; 209,200; 240,239,201; 208,229,75
119,173; 145,215; 237,236,199; 92,204,74
147,275; 204,316; 208,207,177; 16,24,17
159,322; 166,338; 199,198,168; 20,54,240
160,326; 174,402; 181,186,159; 188,74,90
218,542; 325,655; 112,186,170; 80,190,94


Arrow

550,440; 636,576; 249,235,225; 25,10,98
580,388; 639,454; 111,116,116; 180,4,45
613,331; 764,417; 154,77,34; 22,78,60
693,192; 798,236; 230,229,193; 58,16,90
695,189; 783,385; 12,13,14; 210,14,5
434,641; 530,766; 99,119,220; 230,55,86
456,603; 463,702; 99,186,172; 170,47,73
530,474; 613,492; 97,115,82; 93,29,45
562,419; 646,475; 111,116,116; 180,4,45
590,370; 669,449; 231,232,234; 220,1,92
608,339; 752,436; 171,235,247; 189,31,97
660,249; 757,435; 212,235,247; 201,14,97
412,679; 481,775; 80,186,175; 174,57,73
484,554; 585,576; 180,184,188; 210,4,74
548,443; 579,541; 64,141,210; 208,70,82
562,419; 680,472; 231,232,234; 220,1,92
616,325; 742,413; 117,188,255; 209,54,100
650,266; 741,386; 12,13,14; 210,14,5
690,197; 821,245; 228,227,191; 58,16,89


## What is the color-changing pattern of each shape and why?

Hint 1: (arrow shape)

You might find a clue on your keyboard.

Hint 2: (arrow shape)

• Hmm ... I used my super-duper mod powers to discover that you do have a hidden Lifehacks account, but you don't have just 1 rep there (unless you persuaded one of the Lifehacks mods to suspend you for a few hours). – Rand al'Thor Nov 24 '16 at 0:29

Jigsaw

The new RGB components depend only on the old ones, individually.
Namely:
$\mathrm{R_{new}} = \mathrm{mod}(1\times\mathrm{R_{old}},256)$
$\mathrm{G_{new}} = \mathrm{mod}(13\times\mathrm{G_{old}},256)$
$\mathrm{B_{new}} = \mathrm{mod}(37\times\mathrm{B_{old}},256)$
The explanation of the factors $1$, $13$ and $37$ might be the number of gold, silver and bronze badges on the profile as shown on the related picture.

Logo

Based on the animation, it seems x coordinates ($\mathrm{pixel}_x-\mathrm{shape}_x$) are important in this one. The logo image is told to be 120x150 pixels, so the thresholds where the rules change are at 40 and 80 pixels on the horizontal axis.
In the left part of it the transformations are:
$\mathrm{R_{new}} = \mathrm{mod}(76\times\mathrm{R_{old}},256)$
$\mathrm{G_{new}} = \mathrm{mod}(105\times\mathrm{G_{old}},256)$
$\mathrm{B_{new}} = \mathrm{mod}(102\times\mathrm{B_{old}},256)$
In the middle:
$\mathrm{R_{new}} = \mathrm{mod}(101\times\mathrm{R_{old}},256)$
$\mathrm{G_{new}} = \mathrm{mod}(104\times\mathrm{G_{old}},256)$
$\mathrm{B_{new}} = \mathrm{mod}(97\times\mathrm{B_{old}},256)$
In the right part:
$\mathrm{R_{new}} = \mathrm{mod}(99\times\mathrm{R_{old}},256)$
$\mathrm{G_{new}} = \mathrm{mod}(107\times\mathrm{G_{old}},256)$
$\mathrm{B_{new}} = \mathrm{mod}(115\times\mathrm{B_{old}},256)$
The numbers in the factors are ASCII code for 'Lifehacks', the name of the hidden community below the logo on the related picture.

Arrow

This seems to be an RGB2HSV conversion (the old RGB channels are converted to HSV, which are interpreted as the new RGB channels - for details of the calculation, see Levieux's answer).
As LukasRotter pointed it out, the 'About me' section on the related picture has only the letters 'H', 'S' and 'B' capitalized, which stand for 'hue', 'saturation' and 'brightness', suggesting an HSB (also called HSV) representation.

• The jigsaw formula is correct, but please also explain why these factors (13, 37) and the jigsaw shape are used (the answer is inside the image). – user14478 Nov 24 '16 at 12:09
• Addition (not sure if that was what you ment with the picture): The badges are formed like the Jigsaw pice when not looking on the profile but rather on one of the puzzles :) – geisterfurz007 Nov 24 '16 at 13:38
• @LukasRotter, can we maybe get some more data about the arrow case? Also, I'd be happy to help providing how the data for 'logo' should look like without the typo, if you are about to correct that one. – elias Nov 29 '16 at 9:41
• @elias Done. Added some new arrow examples and fixed the logo data (didn't update the image) – user14478 Nov 30 '16 at 10:52
• thanks, @Lukas, I've updated the logo part of my answer, and will give another try to the arrow part – elias Nov 30 '16 at 11:37

Continuing Elias' work on the color changing pattern of the arrow (so please give him credit for it):

$\mathrm{B_{new}} = \mathrm{ROUND}((\mathrm{max}(\mathrm{R_{old}}, \mathrm{R_{old}},\mathrm{R_{old}})/2.55)$ works for all values given by Lukas Rotter. I'm not sure if $2.55$ is indeed the intended value; it is the maximum possible value ($255$) divided by $100$.
For $\mathrm{G_{new}}$ I have:
$\mathrm{G_{new}} = \mathrm{ROUND}((\mathrm{max}(\mathrm{R_{old}}, \mathrm{R_{old}},\mathrm{R_{old}})-\mathrm{min}(\mathrm{R_{old}}, \mathrm{R_{old}},\mathrm{R_{old}}))/(\mathrm{max}(\mathrm{R_{old}}, \mathrm{R_{old}},\mathrm{R_{old}})/100))$
The lay-out is not quite working out as I intended, so I'll explain it a little bit: Take the maximum of the old values, subtract the minimum of the old values and then divide the result by (the same maximum divided by $100$). And finally round the whole thing.
$\mathrm{R_{new}}$ seems to depend (somewhat) on which value out of $\mathrm{R_{old}}$, $\mathrm{G_{old}}$ and $\mathrm{B_{old}}$was the highest.
If $\mathrm{R_{old}}$ has the highest value --> $\mathrm{R_{new}}$ will be low.
if $\mathrm{B_{old}}$ has the highest value --> $\mathrm{R_{new}}$ will be high. Work in progress...
I've also got to work out how this relates to the two hints given...

Update:

As Elias found out the actual conversion is an RGB-to-HSV conversion, where the resulting HSV values are then re-interpreted as RGB values.

• great findings! – elias Dec 1 '16 at 13:16
• Meanwhile I figured out what the calculation rule is, but don't understand the hint at all. – elias Dec 1 '16 at 13:39
• Nice, well spotted! Makes it a lot clearer why R_new is so difficult to guess. All I've apparently been doing in the answer above is trying to reproduce that formula... :P – Levieux Dec 1 '16 at 13:48