Updates to bb-2016 styling.

master
ben-burlingham 10 years ago
parent 6dfbc073d7
commit b2e22b5bb0
  1. 7
      css/style.css
  2. 35
      index.html

@ -1,10 +1,3 @@
.problem-description {
background:#f5f2f0;
font-family:consolas;
line-height:24px;
padding:20px;
}
.results-matrix { .results-matrix {
font-size:0; font-size:0;
margin:0 auto; margin:0 auto;

@ -2,34 +2,31 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>D3</title> <title>Pixel Palettes &lt; BB</title>
<script type="text/javascript" src='../bb-2016/js/ui.js'></script>
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="/beb-2016/css/style.css">
<link rel="stylesheet" href="/beb-2016/css/prism.css">
</head> </head>
<body> <body>
<h1>Pixel Palettes</h1> <h1>Pixel Palettes</h1>
<!-- http://gogs.benburlingham.com/ben.burlingham/pixel-palettes --> <h2>
An <a href="http://codegolf.stackexchange.com/questions/33172/american-gothic-in-the-palette-of-mona-lisa-rearrange-the-pixels">interesting challenge</a> from Codegolf Stack Exchange
Tried my hand at <a href="http://codegolf.stackexchange.com/questions/33172/american-gothic-in-the-palette-of-mona-lisa-rearrange-the-pixels">this interesting challenge</a>: </h2>
<p class='problem-description'>
You are given two true color images, the Source and the Palette. They do not necessarily have the same dimensions but it is guaranteed that their areas are the same, i.e. they have the same number of pixels.
<br><br> <h3>Problem Statement</h3>
Your task is to create an algorithm that makes the most accurate looking copy of the Source by only using the pixels in the Palette. Each pixel in the Palette must be used exactly once in a unique position in this copy. The copy must have the same dimensions as the Source. <blockquote>
</p> You are given two true color images, the Source and the Palette. They do not necessarily have the same dimensions but it is guaranteed that their areas are the same, i.e. they have the same number of pixels.
<br><br>
Your task is to create an algorithm that makes the most accurate looking copy of the Source by only using the pixels in the Palette. Each pixel in the Palette must be used exactly once in a unique position in this copy. The copy must have the same dimensions as the Source.
</blockquote>
<p> <p>
I developed a <a href="http://codegolf.stackexchange.com/questions/33172/american-gothic-in-the-palette-of-mona-lisa-rearrange-the-pixels/35960#35960">solution</a> that takes a random pixel and uses a binary search to find a match in the target palette, weighted for the red component. Here are the results for that approach. I developed a <a href="http://codegolf.stackexchange.com/questions/33172/american-gothic-in-the-palette-of-mona-lisa-rearrange-the-pixels/35960#35960">solution</a> that takes a random pixel and uses a binary search to find a match in the target palette, weighted for the red component. Here are the results for that approach.
</p> </p>
<h2>Results</h2> <h3>Results</h3>
<p> <p>
Images are links, diagonals are originals. Images are links, diagonals are originals.
@ -152,9 +149,13 @@ I developed a <a href="http://codegolf.stackexchange.com/questions/33172/america
</div> </div>
<h2>Source code</h2> <h3>Code</h3>
<p>
<a href="http://gogs.benburlingham.com/ben.burlingham/pixel-palettes" target="_blank">Source</a>
</p>
<pre class='line-numbers'><code class='language-javascript'>var startTime = new Date().getTime(); <pre class='language-javascript line-numbers'><code class='language-javascript'>var startTime = new Date().getTime();
var fs = require("fs"); var fs = require("fs");
var pngjs = require("pngjs").PNG; var pngjs = require("pngjs").PNG;

Loading…
Cancel
Save