<commit_before>function negate(imdata) {
    "use strict";
    var pos;

    for(var x = 0; x < 500; x++) {
        for(var y = 0; y < 500; y++) {
            // pixel position
            pos = (imdata.width * 4 * y) + (x * 4);
            // channels
            imdata.data[pos] = 255 - imdata.data[pos];
            imdata.data[pos+1] = 255 - imdata.data[pos+1];
            imdata.data[pos+2] = 255 - imdata.data[pos+2];
        }
    }
}

onmessage = function(evt) {
    var imdata = evt.data.imdata;

    negate(imdata);

    postMessage({ type: "finished", imdata: imdata });
};<commit_msg>Added a progressbar for negation<commit_after>function negate(imdata) {
    "use strict";
    var pos;

    for(var x = 0; x < 500; x++) {
        for(var y = 0; y < 500; y++) {
            // pixel position
            pos = (imdata.width * 4 * y) + (x * 4);
            // channels
            imdata.data[pos] = 255 - imdata.data[pos];
            imdata.data[pos+1] = 255 - imdata.data[pos+1];
            imdata.data[pos+2] = 255 - imdata.data[pos+2];
        }
        postMessage({
            type: "progress",
            val: y / 5
        });
    }
}

onmessage = function(evt) {
    var imdata = evt.data.imdata;

    negate(imdata);

    postMessage({ type: "finished", imdata: imdata });
};
{'fraction_non_alphanumeric': 0.1620583717357911, 'fraction_numerical': 0.03609831029185868, 'mean_word_length': 1.748945147679325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '1026450', 'n_tokens_mistral': 494, 'n_tokens_neox': 452, 'n_words': 104}