• fullscreen
  • SelfPrintingSketch2.pde
  • BufferedReader reader;
    String line, c, str;
    int count, w, pixelSize;
    boolean read;
    void setup(){
      reader = createReader("SelfPrintingSketch2.pde");
      read = true;
      pixelSize = 15;
      str = "";
        line = reader.readLine();
      } catch (IOException e){
        line = null;
      if (line == null){
        read = false;
      } else {
        for(int x = 0; x < line.length(); x++){
          c = String.valueOf(line.charAt(x));
        str = str + line; 
      w = nearestSquare(count);
      size(w * pixelSize, w * pixelSize);
        for(int i = 0; i < str.length(); i++){
          rect(pixelSize*(i % w), pixelSize*(i / w) , pixelSize, pixelSize);
    int nearestSquare(int n){
      int i = 2;
      while(i*i < n){
      return i;


    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.



    Report Sketch

    Report for inappropriate content

    Please provide details if possible:

    Your have successfully reported the sketch. Thank you very much for helping to keep OpenProcessing clean and tidy :)

    Make a Copyright Infringement claim

    Richard Spellman

    Self Printing Sketch 1

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    First attempt at writing a sketch that prints itself out as an image. bit of a kludgy mess. have to copy the pde file into data folder before posting, which is annoying.
    doesn't seem to work consistently either, sometimes it just won't display. and there was something funny going on with the size of the sketch on import. works fine when run locally within processing...

    ale plus+
    1 Nov 2011
    Nice idea.
    ale plus+
    1 Nov 2011
    Maybe the output would be nicer without any stroke, only the colour information, donĀ“t know...
    You need to login/register to comment.