<commit_before>---
layout: template
---

<h1>Glitch Cruiser</h1>
<p>When you upload an image it appears in the center surrounded by glitchy alternatives.
    If one of these images suits your fancy, click on it and it will become the new source for the 
    next round of glitches. If you do not like any of the suggested glitches, click on the center
    image, and the alternatives will change, but your source will not.</p>
<div id="form">
    <input type="file" id="uploader">
    <label>Enable experimental functions? <input type="checkbox" id="experimental" /></label>
</div>
<div id="output"></div>
<script>
    function handleFileSelect(e) {
        var file = e.target.files[0];
        // Only process image files.
        if (!file.type.match('image.*')) {
            return;
        }
        var reader = new FileReader();
        // Closure to capture the file information.
        reader.onload = function(e) {
            var img = document.createElement("img");
            img.onload = function() {
                generate(img);
            };
            img.src = e.target.result;
        };
        reader.readAsDataURL(file);
        document.getElementById("output").innerHTML = "";
    }

    function generate(img){
        /* cleanup */
        document.getElementById("output").innerHTML = "";
        var imgs = document.getElementsByTagName("img");
        for(var i = 0; i < imgs.length; i++){
            imgs[i].destroy();
        }
        /* setup */
        var orig = img;
        var width = img.width;
        var height = img.height;
        var canvas = document.createElement('canvas');
        canvas.width = width;
        canvas.height = height;
        var ctx = canvas.getContext('2d');
        ctx.drawImage(img, 0, 0);
        /* execute */
        for (var i = 1; i < 10;i++){
            if(i==5 && typeof img == "object"){
                ctx.drawImage(orig,0,0);
                drawDitherResulti2(canvas,original,"original");
                /* Original Image */
            }else{
                ctx.drawImage(img, 0, 0);
                drawDitherResult2(canvas,seqGlitch,"seqGlitch");
                /* generated from Original */
            }
        }
        document.getElementsBySelector('#output img')[0].addEventListener('click', function(){ generate(this); }, false);
    }
    document.getElementById('uploader').addEventListener('change', handleFileSelect, false);
</script><commit_msg>fix typo<commit_after>---
layout: template
---

<h1><NAME></h1>
<p>When you upload an image it appears in the center surrounded by glitchy alternatives.
    If one of these images suits your fancy, click on it and it will become the new source for the 
    next round of glitches. If you do not like any of the suggested glitches, click on the center
    image, and the alternatives will change, but your source will not.</p>
<div id="form">
    <input type="file" id="uploader">
    <label>Enable experimental functions? <input type="checkbox" id="experimental" /></label>
</div>
<div id="output"></div>
<script>
    function handleFileSelect(e) {
        var file = e.target.files[0];
        // Only process image files.
        if (!file.type.match('image.*')) {
            return;
        }
        var reader = new FileReader();
        // Closure to capture the file information.
        reader.onload = function(e) {
            var img = document.createElement("img");
            img.onload = function() {
                generate(img);
            };
            img.src = e.target.result;
        };
        reader.readAsDataURL(file);
        document.getElementById("output").innerHTML = "";
    }

    function generate(img){
        /* cleanup */
        document.getElementById("output").innerHTML = "";
        var imgs = document.getElementsByTagName("img");
        for(var i = 0; i < imgs.length; i++){
            imgs[i].destroy();
        }
        /* setup */
        var orig = img;
        var width = img.width;
        var height = img.height;
        var canvas = document.createElement('canvas');
        canvas.width = width;
        canvas.height = height;
        var ctx = canvas.getContext('2d');
        ctx.drawImage(img, 0, 0);
        /* execute */
        for (var i = 1; i < 10;i++){
            if(i==5 && typeof img == "object"){
                ctx.drawImage(orig,0,0);
                drawDitherResult2(canvas,original,"original");
                /* Original Image */
            }else{
                ctx.drawImage(img, 0, 0);
                drawDitherResult2(canvas,seqGlitch,"seqGlitch");
                /* generated from Original */
            }
        }
        document.getElementsBySelector('#output img')[0].addEventListener('click', function(){ generate(this); }, false);
    }
    document.getElementById('uploader').addEventListener('change', handleFileSelect, false);
</script>
{'fraction_non_alphanumeric': 0.13352388730093917, 'fraction_numerical': 0.007349938750510413, 'mean_word_length': 2.1104761904761906, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6673475', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1299, 'n_words': 373}