Heykuki News

TopNewBestAskShowJobs
TopNewBestAskShowJobs
Hack the drawing cats site to turn your own images into cats
1 point
sirrodgepodge
9 years ago
1. convert an image you would like to turn into a cat into base64 (with a tool like this: https://www.base64-image.de/)

2. Go to this site which lets you turn your drawing into cats: http://affinelayer.com/pixsrv/index.html

3. Paste this function into the console and execute it on the base64 data you produced in step 1 (then click the 'Process' button in the converter that appears on the page with your image):

  function main(base64) {
    function create_editor(config) {
      var editor = new Editor(config)
      var elem = document.getElementById(config.name)
      elem.appendChild(editor.view.ctx.canvas)
      editor.view.ctx.canvas.onselectstart = function(e) {
        e.preventDefault(); 
        return false; 
      }
      editors.push(editor)
    }

    create_editor({
      name: "edges2cats",
      generate_url: base_url + "/edges2cats_AtoB",
      mode: "line",
      clear: "#FFFFFF",
      colors: {
        line: "#000000",
        eraser: "#ffffff",
      },
      draw: "#000000",
      initial_input: base64,
      initial_output: "",
      sheet_url: "/pixsrv/edges2cats-sheet.jpg",
    })

    init();
  }