random image

  • /*
     * @title random image
     * @description my bookmarklet
     * @include http://*
     * @license MIT License
     * @require http://github.com/arikui/image_processing.js/raw/master/image_processing.js
     */
    
    var canvas = document.createElement("canvas");
    canvas.width = canvas.height = prompt("size");
    var ip = new ImageProcessing(canvas);
    arguments.callee.ip = ip;
    
    ip.lock().each(function(px, x, y, self){
      px = ImageProcessing.Color.fromHsv(Math.random() * 359, 255, 128);
      self.setPixel(x, y, px);
    }).unlock().update();
    
    open(ip.data(), "_blank");
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/08/30 21:38:56 - 2011-08-30
  2. 2010/05/27 23:14:39 - 2010-05-27
  3. 2010/05/27 18:09:24 - 2010-05-27