├── .gitignore ├── .gitmodules ├── LICENSE ├── Obj2Raw ├── Obj2Raw.pde ├── teapot.obj └── teapot │ ├── res_5543F2C4_teapot.jpg │ ├── res_5543F2C4_teapot.obj │ ├── res_EA87724E_teapot.jpg │ ├── res_EA87724E_teapot.obj │ ├── res_EA879E20_teapot.jpg │ ├── res_EA879E20_teapot.obj │ ├── res_FE1A36A0_teapot.jpg │ ├── res_FE1A36A0_teapot.obj │ ├── res_FE1AB363_teapot.jpg │ ├── res_FE1AB363_teapot.obj │ ├── res_FE1AE51D_teapot.jpg │ ├── res_FE1AE51D_teapot.obj │ └── teapot_res.raw ├── PROCESSING 3 ├── Obj2Raw │ ├── Obj2Raw.pde │ ├── teapot.obj │ └── teapot │ │ ├── res_5543F2C4_teapot.jpg │ │ ├── res_5543F2C4_teapot.obj │ │ ├── res_EA87724E_teapot.jpg │ │ ├── res_EA87724E_teapot.obj │ │ ├── res_EA879E20_teapot.jpg │ │ ├── res_EA879E20_teapot.obj │ │ ├── res_FE1A36A0_teapot.jpg │ │ ├── res_FE1A36A0_teapot.obj │ │ ├── res_FE1AB363_teapot.jpg │ │ ├── res_FE1AB363_teapot.obj │ │ ├── res_FE1AE51D_teapot.jpg │ │ ├── res_FE1AE51D_teapot.obj │ │ └── teapot_res.raw ├── blendimages │ ├── bl │ │ ├── bl1000.jpg │ │ ├── bl1001.jpg │ │ ├── bl1002.jpg │ │ ├── bl1003.jpg │ │ ├── bl1004.jpg │ │ └── bl1005.jpg │ ├── blendimages.pde │ ├── test.jpg │ └── test │ │ ├── res_301E1771_test.jpg │ │ ├── res_301ECD7B_test.jpg │ │ └── res_301EFDA1_test.jpg ├── decayscreen │ ├── decayscreen.pde │ ├── res_74230_test.jpg │ └── test.jpg ├── pixeldrifter │ ├── pixeldrifter.pde │ ├── test.jpg │ └── test │ │ ├── res_3DFBDFBD_test.jpg │ │ ├── res_6E03D9C8_test.jpg │ │ ├── res_C46F2C23_test.jpg │ │ └── res_FF2FD95F_test.jpg ├── pngglitch │ ├── code │ │ └── pngj.jar │ ├── pngglitch.pde │ ├── test.png │ └── test │ │ ├── res_17770818_test.png │ │ ├── res_17774D5E_test.png │ │ ├── res_17775089_test.png │ │ ├── res_17775BBA_test.png │ │ └── res_17776F51_test.png ├── slitscan │ ├── res_18923_test.jpg │ ├── res_19233_test.jpg │ ├── res_59570_test.jpg │ ├── res_62271_test.jpg │ ├── slitscan.pde │ └── test.jpg ├── threadraw │ ├── test.jpg │ ├── test │ │ ├── res_0B322FC3_test.jpg │ │ ├── res_0B325285_test.jpg │ │ ├── res_3E126C1B_test.jpg │ │ └── res_9983DEBC_test.jpg │ └── threadraw.pde ├── ultimateSort │ ├── test.jpg │ ├── test │ │ ├── res_43D4F76F_test.jpg │ │ └── res_D16C8172_test.jpg │ └── ultimateSort.pde ├── watmap │ ├── bl │ │ ├── bl1000.jpg │ │ ├── bl1001.jpg │ │ ├── bl1002.jpg │ │ ├── bl1003.jpg │ │ ├── bl1004.jpg │ │ └── bl1005.jpg │ ├── nyt │ │ ├── NYTimes-Dec1900-Jan1901_0003.jpg │ │ ├── NYTimes-Dec1900-Jan1901_0004.jpg │ │ ├── NYTimes-Dec1900-Jan1901_0005.jpg │ │ ├── NYTimes-Dec1900-Jan1901_0006.jpg │ │ ├── NYTimes-Dec1900-Jan1901_0007.jpg │ │ ├── NYTimes-Dec1900-Jan1901_0008.jpg │ │ ├── NYTimes-Dec1900-Jan1901_0009.jpg │ │ └── NYTimes-Dec1900-Jan1901_0010.jpg │ ├── test.jpg │ ├── test │ │ ├── res_00CB832B_test.jpg │ │ └── res_7CAE6A7A_test.jpg │ └── watmap.pde ├── wavelets │ ├── code │ │ └── JWave.jar │ ├── test.jpg │ ├── test │ │ ├── res_A29820C2_test.jpg │ │ ├── res_A298612B_test.jpg │ │ ├── res_A2986DB5_test.jpg │ │ └── res_A2989237_test.jpg │ └── wavelets.pde ├── wrongqsort │ ├── test.jpg │ ├── test │ │ ├── res_7B682694_test.jpg │ │ ├── res_7B684217_test.jpg │ │ └── res_7B6873D4_test.jpg │ └── wrongqsort.pde └── wzipprocess2 │ ├── res_0018_test.jpg │ ├── res_0022_test.jpg │ ├── res_0034_test.jpg │ ├── res_0062_test.jpg │ ├── test.jpg │ └── wzipprocess2.pde ├── README.md ├── TEMPLATE ├── TEMPLATE.pde └── test.jpg ├── blendimages ├── bl │ ├── bl1000.jpg │ ├── bl1001.jpg │ ├── bl1002.jpg │ ├── bl1003.jpg │ ├── bl1004.jpg │ └── bl1005.jpg ├── blendimages.pde ├── test.jpg └── test │ ├── res_301E1771_test.jpg │ ├── res_301ECD7B_test.jpg │ └── res_301EFDA1_test.jpg ├── composite_video_simulator ├── composite_video_simulator.pde ├── test.jpg └── test │ ├── res_3757BA36_test.jpg │ ├── res_A0DC39B8_test.jpg │ └── res_F9E501BD_test.jpg ├── cutsort ├── code │ └── gson-2.3.1.jar ├── cutsort.pde ├── test.jpg └── test │ ├── _test_encoded1450.jpg │ ├── res_1450EB39_test.jpg │ ├── test_data1450.json │ └── test_encoded1450.jpg ├── decayscreen ├── decayscreen.pde ├── res_74230_test.jpg └── test.jpg ├── decompose_paint ├── decompose_paint.pde ├── test.jpg └── test │ ├── res_852985E3_test.jpg │ ├── res_85299ABC_test.jpg │ └── res_8529C4BC_test.jpg ├── distorter ├── distorter.pde ├── test.jpg └── test │ ├── res_B9083ACB_test.jpg │ ├── res_B9085B8B_test.jpg │ ├── res_B9086BEA_test.jpg │ └── res_B908C02B_test.jpg ├── drawing_generative ├── drawing_generative.pde ├── res_40524_test.jpg ├── res_95922_test.jpg └── test.jpg ├── drawing_strokes ├── drawing_strokes.pde ├── res_23733_test.jpg ├── res_52931_test.jpg ├── res_72368_test.jpg ├── res_84971_test.jpg └── test.jpg ├── fm ├── colorspaces.pde ├── fm.pde ├── test.jpg └── test │ ├── res_436DBD9F_test.jpg │ ├── res_AA9DD1D1_test.jpg │ ├── res_AD5D536B_test.jpg │ ├── res_B984EF78_test.jpg │ └── res_E535BB24_test.jpg ├── fractalify ├── fractalify.pde ├── res_6762_test.jpg ├── res_9731_test.jpg └── test.jpg ├── granularresynth ├── audiores.mp3 ├── granularresynth.pde └── imgres.jpg ├── imagelens ├── imagelens.pde ├── lens1.jpg ├── res_23609_test.jpg ├── res_28828_test.jpg ├── res_29294_test.jpg ├── res_75310_test_lens1.jpg └── test.jpg ├── imageslicer ├── imageslicer.pde ├── res_11803_test.jpg ├── res_35825_test.jpg ├── res_38271_test.jpg ├── res_43987_test.jpg ├── res_90965_test.jpg └── test.jpg ├── imsyntex ├── colorspaces.pde ├── imsyntex.pde ├── test.jpg └── test │ ├── res_00CA9A_test.jpg │ ├── res_8AB25D_test.jpg │ └── res_8FE3A8_test.jpg ├── lz77_images ├── lz77_images.pde ├── test.jpg └── test │ ├── res_45919D63_test.jpg │ └── res_62D66D06_test.jpg ├── lz77_raws ├── d_test_glitched.raw ├── lz77_raws.pde ├── test.jpg ├── test.lz77 ├── test.raw ├── test_glitched.jpg └── test_glitched.lz77 ├── median_filter ├── concurrent.pde ├── median_filter.pde ├── test.jpg └── test │ └── res_BE92D61D_test.jpg ├── mirrorimage ├── mirrorimage.pde ├── res_34901_test.jpg ├── res_36847_test.jpg ├── res_75749_test.jpg └── test.jpg ├── moire ├── Maps.pde ├── moire.pde └── moire │ ├── anim.gif │ ├── res_4BD33750_moire.jpg │ ├── res_4BD3589F_moire.jpg │ ├── res_4BD36E56_moire.jpg │ ├── res_C50ED0B6_moire.jpg │ └── res_E8BA22F0_moire.jpg ├── ntsc_analogtv ├── code │ └── GenerateMeLibs.jar ├── frame_130_24232.png ├── frame_161_24232.png ├── frame_188_24232.png ├── frame_208_24232.png ├── frame_75_24232.png ├── frame_95_24232.png ├── frame_98_24232.png ├── ntsc_analogtv.pde └── test.jpg ├── pix2line ├── grid_examples │ ├── grid1.jpg │ ├── grid2.jpg │ └── grid3.jpg ├── pix2line.pde ├── test.jpg └── test │ ├── res_336057F4_test.jpg │ ├── res_6CA63EA7_test.jpg │ ├── res_84DC18E0_test.jpg │ └── res_E8CF0AB7_test.jpg ├── pixeldrifter ├── pixeldrifter.pde ├── test.jpg └── test │ ├── res_3DFBDFBD_test.jpg │ ├── res_6E03D9C8_test.jpg │ ├── res_C46F2C23_test.jpg │ └── res_FF2FD95F_test.jpg ├── pngglitch ├── code │ └── pngj.jar ├── pngglitch.pde ├── test.png └── test │ ├── res_17770818_test.png │ ├── res_17774D5E_test.png │ ├── res_17775089_test.png │ ├── res_17775BBA_test.png │ └── res_17776F51_test.png ├── shufflestream ├── res_test.jpg ├── shufflestream.pde └── test.jpg ├── slitscan ├── res_18923_test.jpg ├── res_19233_test.jpg ├── res_59570_test.jpg ├── res_62271_test.jpg ├── slitscan.pde └── test.jpg ├── threadraw ├── test.jpg ├── test │ ├── res_0B322FC3_test.jpg │ ├── res_0B325285_test.jpg │ ├── res_3E126C1B_test.jpg │ └── res_9983DEBC_test.jpg └── threadraw.pde ├── ultimateSort ├── test.jpg ├── test │ ├── res_43D4F76F_test.jpg │ └── res_D16C8172_test.jpg └── ultimateSort.pde ├── watmap ├── bl │ ├── bl1000.jpg │ ├── bl1001.jpg │ ├── bl1002.jpg │ ├── bl1003.jpg │ ├── bl1004.jpg │ └── bl1005.jpg ├── nyt │ ├── NYTimes-Dec1900-Jan1901_0003.jpg │ ├── NYTimes-Dec1900-Jan1901_0004.jpg │ ├── NYTimes-Dec1900-Jan1901_0005.jpg │ ├── NYTimes-Dec1900-Jan1901_0006.jpg │ ├── NYTimes-Dec1900-Jan1901_0007.jpg │ ├── NYTimes-Dec1900-Jan1901_0008.jpg │ ├── NYTimes-Dec1900-Jan1901_0009.jpg │ └── NYTimes-Dec1900-Jan1901_0010.jpg ├── test.jpg ├── test │ ├── res_00CB832B_test.jpg │ └── res_7CAE6A7A_test.jpg └── watmap.pde ├── wavelets ├── code │ └── JWave.jar ├── test.jpg ├── test │ ├── res_A29820C2_test.jpg │ ├── res_A298612B_test.jpg │ ├── res_A2986DB5_test.jpg │ └── res_A2989237_test.jpg └── wavelets.pde ├── wrongqsort ├── test.jpg ├── test │ ├── res_7B682694_test.jpg │ ├── res_7B684217_test.jpg │ └── res_7B6873D4_test.jpg └── wrongqsort.pde └── wzipprocess2 ├── res_0018_test.jpg ├── res_0022_test.jpg ├── res_0034_test.jpg ├── res_0062_test.jpg ├── test.jpg └── wzipprocess2.pde /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.tmp 3 | 4 | # Mobile Tools for Java (J2ME) 5 | .mtj.tmp/ 6 | 7 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 8 | hs_err_pid* 9 | 10 | _images/ 11 | sketch.properties 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sonification"] 2 | path = sonification 3 | url = https://github.com/SonifyIt/sonification 4 | [submodule "GLIC"] 5 | path = GLIC 6 | url = https://github.com/GlitchCodec/GLIC 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | 26 | -------------------------------------------------------------------------------- /Obj2Raw/teapot/res_5543F2C4_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/res_5543F2C4_teapot.jpg -------------------------------------------------------------------------------- /Obj2Raw/teapot/res_EA87724E_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/res_EA87724E_teapot.jpg -------------------------------------------------------------------------------- /Obj2Raw/teapot/res_EA879E20_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/res_EA879E20_teapot.jpg -------------------------------------------------------------------------------- /Obj2Raw/teapot/res_FE1A36A0_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/res_FE1A36A0_teapot.jpg -------------------------------------------------------------------------------- /Obj2Raw/teapot/res_FE1AB363_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/res_FE1AB363_teapot.jpg -------------------------------------------------------------------------------- /Obj2Raw/teapot/res_FE1AE51D_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/res_FE1AE51D_teapot.jpg -------------------------------------------------------------------------------- /Obj2Raw/teapot/teapot_res.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/Obj2Raw/teapot/teapot_res.raw -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/res_5543F2C4_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/res_5543F2C4_teapot.jpg -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/res_EA87724E_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/res_EA87724E_teapot.jpg -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/res_EA879E20_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/res_EA879E20_teapot.jpg -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/res_FE1A36A0_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/res_FE1A36A0_teapot.jpg -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/res_FE1AB363_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/res_FE1AB363_teapot.jpg -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/res_FE1AE51D_teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/res_FE1AE51D_teapot.jpg -------------------------------------------------------------------------------- /PROCESSING 3/Obj2Raw/teapot/teapot_res.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/Obj2Raw/teapot/teapot_res.raw -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/bl/bl1000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/bl/bl1000.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/bl/bl1001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/bl/bl1001.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/bl/bl1002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/bl/bl1002.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/bl/bl1003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/bl/bl1003.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/bl/bl1004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/bl/bl1004.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/bl/bl1005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/bl/bl1005.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/blendimages.pde: -------------------------------------------------------------------------------- 1 | // Blend images with a target 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | // * click for random change of parameters 8 | 9 | // set up filename of the target 10 | String filename = "test"; 11 | String fileext = ".jpg"; 12 | String foldername = "./"; 13 | 14 | // how to blend COLOR or channel VALUE? 15 | int mode = BLEND_COLOR; // BLEND_VALUE or BLEND_COLOR 16 | // if channel VALUE set what channel 17 | int VALUE_FOR_BLEND = BRIGHTNESS; // only if BLEND_VALUE chosen 18 | 19 | // do you want random number of source used 20 | boolean random_source = false; 21 | 22 | int max_display_size = 1000; // viewing window size (regardless image size) 23 | 24 | boolean started = false; 25 | 26 | boolean do_blend = false; // blend image after process 27 | int blend_mode = OVERLAY; // blend type 28 | 29 | // set up source image set 30 | // using below variables filenames from the set are constructed 31 | // example: my images have names: bl1000.jpg, bl1001.jpg etc... 32 | // and are located in 'bl/' folder 33 | // I have 6 of them, with constant prefix: "bl/bl100" (pattern_prefix) 34 | // then every file has one sequence digit from 0 to 5 (pattern_init and pattern_length) 35 | // with 'pattern_size' digits for the sequence (here: one digit) 36 | // at the end 'file_ext' is added 37 | // below setting produce six names: bl/bl1000.jpg, bl/bl1001.jpg, bl/bl1002.jpg, bl/bl1003.jpg, bl/bl1004.jpg, bl/bl1005.jpg 38 | final static String pattern_prefix = "bl/bl100"; 39 | final static String file_ext = ".jpg"; 40 | final static int pattern_init = 0; // starting number 41 | final static int pattern_length = 6; // how many images from the set, don't use more than 10 42 | final static int pattern_size = 1; // number of digits 43 | 44 | final static int BLEND_COLOR = 0; 45 | final static int BLEND_VALUE = 1; 46 | 47 | // working buffer 48 | PGraphics buffer; 49 | 50 | // image 51 | PImage img; 52 | 53 | String sessionid; 54 | 55 | PImage[] sset = new PImage[pattern_length]; 56 | 57 | void setup() { 58 | sessionid = hex((int)random(0xffff), 4); 59 | img = loadImage(foldername+filename+fileext); 60 | img.loadPixels(); 61 | 62 | buffer = createGraphics(img.width, img.height); 63 | buffer.beginDraw(); 64 | buffer.loadPixels(); 65 | 66 | // calculate window size 67 | float ratio = (float)img.width/(float)img.height; 68 | int neww, newh; 69 | if (ratio < 1.0) { 70 | neww = (int)(max_display_size * ratio); 71 | newh = max_display_size; 72 | } else { 73 | neww = max_display_size; 74 | newh = (int)(max_display_size / ratio); 75 | } 76 | 77 | surface.setResizable(true); 78 | surface.setSize(neww, newh); 79 | 80 | for (int i=0; i> 16) &0xff; 109 | v.y = (c >> 8) &0xff; 110 | v.z = c &0xff; 111 | return v; 112 | } 113 | 114 | void processImage() { 115 | 116 | 117 | int[] idx = new int[pattern_length]; 118 | for (int i=0; i5?channel-6:channel; 201 | float cc; 202 | 203 | switch(ch) { 204 | case RED: 205 | cc = red(c); 206 | break; 207 | case GREEN: 208 | cc = green(c); 209 | break; 210 | case BLUE: 211 | cc = blue(c); 212 | break; 213 | case HUE: 214 | cc = hue(c); 215 | break; 216 | case SATURATION: 217 | cc = saturation(c); 218 | break; 219 | default: 220 | cc= brightness(c); 221 | break; 222 | } 223 | 224 | return channel>5?255-cc:cc; 225 | } 226 | -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/test/res_301E1771_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/test/res_301E1771_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/test/res_301ECD7B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/test/res_301ECD7B_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/blendimages/test/res_301EFDA1_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/blendimages/test/res_301EFDA1_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/decayscreen/res_74230_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/decayscreen/res_74230_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/decayscreen/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/decayscreen/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/pixeldrifter/pixeldrifter.pde: -------------------------------------------------------------------------------- 1 | // Drift pixels and blend, repeat 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | 8 | // set up filename 9 | String filename = "test"; 10 | String fileext = ".jpg"; 11 | String foldername = "./"; 12 | 13 | int max_display_size = 800; // viewing window size (regardless image size) 14 | 15 | // config 16 | int channel = HUE; // channel data used for shift 17 | float channel_off = 60; // channel value offset 18 | int iteration_no = 50; // number of iterations 10-100 19 | int direction = UP; // UP, DOWN, LEFT, RIGHT 20 | boolean image_mix = false; // mix with original image or current buffer 21 | boolean automate_channel_offset = false; // if true, change channel_offset every iteration 22 | float scale = 0.03; // 0.01 - 0.1, step size (0.01: 2px, 0.1:25px) 23 | float feedback = 0.9; // 0.9 - 0.999 ; blend ratio with original image 24 | 25 | boolean do_blend = false; // blend image after process 26 | int blend_mode = OVERLAY; // blend type 27 | 28 | // working buffer 29 | PGraphics buffer; 30 | 31 | // image 32 | PImage img, imgb; 33 | 34 | String sessionid; 35 | float acho_step; 36 | 37 | void setup() { 38 | sessionid = hex((int)random(0xffff),4); 39 | img = loadImage(foldername+filename+fileext); 40 | imgb = img.get(); 41 | 42 | buffer = createGraphics(img.width, img.height); 43 | buffer.beginDraw(); 44 | buffer.noStroke(); 45 | buffer.smooth(8); 46 | buffer.background(0); 47 | buffer.image(img,0,0); 48 | buffer.endDraw(); 49 | 50 | // calculate window size 51 | float ratio = (float)img.width/(float)img.height; 52 | int neww, newh; 53 | if(ratio < 1.0) { 54 | neww = (int)(max_display_size * ratio); 55 | newh = max_display_size; 56 | } else { 57 | neww = max_display_size; 58 | newh = (int)(max_display_size / ratio); 59 | } 60 | 61 | surface.setResizable(true); 62 | surface.setSize(neww, newh); 63 | 64 | scale = abs(scale); 65 | acho_step = 256.0 / iteration_no; 66 | println(acho_step); 67 | } 68 | 69 | void draw() { 70 | if(iteration_no>0) { 71 | processImage(); 72 | iteration_no--; 73 | println("steps left: "+iteration_no); 74 | } else { 75 | if(do_blend) { 76 | buffer.beginDraw(); 77 | buffer.blend(img,0,0,img.width,img.height,0,0,buffer.width,buffer.height,blend_mode); 78 | buffer.endDraw(); 79 | } 80 | image(buffer,0,0,width,height); 81 | noLoop(); 82 | } 83 | } 84 | 85 | void processImage() { 86 | buffer.beginDraw(); 87 | 88 | for(int x=0;x5?channel-6:channel; 137 | float cc; 138 | 139 | switch(ch) { 140 | case RED: cc = red(c); break; 141 | case GREEN: cc = green(c); break; 142 | case BLUE: cc = blue(c); break; 143 | case HUE: cc = hue(c); break; 144 | case SATURATION: cc = saturation(c); break; 145 | default: cc= brightness(c); break; 146 | } 147 | 148 | return channel>5?255-cc:cc; 149 | } 150 | -------------------------------------------------------------------------------- /PROCESSING 3/pixeldrifter/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/pixeldrifter/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/pixeldrifter/test/res_3DFBDFBD_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/pixeldrifter/test/res_3DFBDFBD_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/pixeldrifter/test/res_6E03D9C8_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/pixeldrifter/test/res_6E03D9C8_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/pixeldrifter/test/res_C46F2C23_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/pixeldrifter/test/res_C46F2C23_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/pixeldrifter/test/res_FF2FD95F_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/pixeldrifter/test/res_FF2FD95F_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/pngglitch/code/pngj.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/pngglitch/code/pngj.jar -------------------------------------------------------------------------------- /PROCESSING 3/pngglitch/pngglitch.pde: -------------------------------------------------------------------------------- 1 | // PNG glitch tool 2 | // Based on hacked pngj and zlib libraries 3 | // https://github.com/leonbloy/pngj 4 | // http://jazzlib.sourceforge.net 5 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 6 | // Licence: http://unlicense.org/ 7 | 8 | // Description: Prepare PNG image, it has to be PNG 24bit. 9 | // Note: Choose different compression level to get different artifacts! 10 | // eg. ImageMagick compression level from 1 to 5 selects different filters: 11 | // 1 - Sub, 2 - Up, 3 - Average, 4 - Paeth, 5 - None 12 | // 0,6-9 are combination of above (based probably on some heuristics) 13 | // Note 2: other convert programs can give different results! 14 | 15 | // Usage: 16 | // * press SPACE to save 17 | // * press 0 to turn on/off filter decode 18 | // * press 1-5 to choose filter used 19 | // * click to glitch around pointed place 20 | // * press q,w,e,r,t to choose glitch method 21 | // * press u for remove (undo) last glitch point 22 | // * press a for add random glitches for lines 23 | // * prezz z for reset all glitches (but not filter) 24 | 25 | // One more reminder: prepare your PNG first, choose PNG24 and compression level (from 0 to 9) 26 | 27 | import ar.com.hjg.pngj.*; 28 | import tsl.corruptinfo.Corruptor; 29 | import java.io.InputStream; 30 | 31 | // set up filename 32 | String filename = "test"; 33 | String fileext = ".png"; 34 | String foldername = "./"; 35 | 36 | int max_display_size = 1000; // viewing window size (regardless image size) 37 | 38 | // select global filtering 39 | boolean do_filtering = false; 40 | int filter = 0; // 0-4, 0 - NONE, 1 - SUB, 2 - UP, 3 - AVERAGE, 4 - PAETH 41 | // choose method for glitch by click (to be honest, do not see any difference) 42 | int glitch_method = Corruptor.RANDOM; // Corruptor.SUB1, Corruptor.ZERO, Corruptor.NEGATE, Corruptor.RANDOM, Corruptor.ADD1 43 | int lines_glitched = 10; // this is average number of glitched lines after 'a' pressed 44 | 45 | // working buffer 46 | PGraphics buffer; 47 | 48 | String sessionid; 49 | 50 | PngReader pngr; 51 | 52 | void setup() { 53 | 54 | sessionid = hex((int)random(0xffff),4); 55 | 56 | Corruptor.force_filter = do_filtering; 57 | Corruptor.filtermethod = filter; 58 | 59 | readPNG(); 60 | buffer = createGraphics(pngr.imgInfo.cols, pngr.imgInfo.rows); 61 | buffer.smooth(8); 62 | buffer.beginDraw(); 63 | buffer.noStroke(); 64 | buffer.background(0); 65 | buffer.endDraw(); 66 | 67 | // calculate window size 68 | float ratio = (float)buffer.width/(float)buffer.height; 69 | int neww, newh; 70 | if(ratio < 1.0) { 71 | neww = (int)(max_display_size * ratio); 72 | newh = max_display_size; 73 | } else { 74 | neww = max_display_size; 75 | newh = (int)(max_display_size / ratio); 76 | } 77 | 78 | surface.setResizable(true); 79 | surface.setSize(neww, newh); 80 | 81 | processImage(); 82 | } 83 | 84 | void draw() { 85 | if (frameCount == 1) { 86 | image(buffer,0,0,width,height); 87 | } 88 | // fill for iterative processing 89 | } 90 | 91 | void readPNG() { 92 | InputStream is = createInput(foldername+filename+fileext); 93 | pngr = new PngReader(is); 94 | } 95 | 96 | void redo() { 97 | print("Reading image..."); 98 | readPNG(); 99 | processImage(); 100 | println("done"); 101 | } 102 | 103 | void processImage() { 104 | buffer.beginDraw(); 105 | 106 | try { 107 | IImageLineSet lines = pngr.readRows(); 108 | for(int i=0;i= 49 && keyCode <=53) { 170 | if(Corruptor.force_filter) { 171 | Corruptor.filtermethod = keyCode - 49; 172 | println("Filter method set to " + getFilterMethodName(Corruptor.filtermethod)); 173 | redo(); 174 | } else { 175 | println("Turn on filtering (press 0)"); 176 | } 177 | } 178 | if(key == 'q') { glitch_method = 0; println("Glitch method set to: " + getGlitchMethodName(0)); } 179 | if(key == 'w') { glitch_method = 1; println("Glitch method set to: " + getGlitchMethodName(1)); } 180 | if(key == 'e') { glitch_method = 2; println("Glitch method set to: " + getGlitchMethodName(2)); } 181 | if(key == 'r') { glitch_method = 3; println("Glitch method set to: " + getGlitchMethodName(3)); } 182 | if(key == 't') { glitch_method = 4; println("Glitch method set to: " + getGlitchMethodName(4)); } 183 | if(keyCode == 48) { 184 | Corruptor.force_filter = !Corruptor.force_filter; 185 | println("Force filter: " + Corruptor.force_filter); 186 | redo(); 187 | } 188 | if(key == 'a') { 189 | println("Random glitches"); 190 | float prob = lines_glitched/(float)buffer.height; 191 | for(int l=0;l 6 | 7 | // - click to change 8 | // - keypress to save result 9 | 10 | // sometimes it copies the image, I don't know why, ignore and click more 11 | 12 | // put file name here 13 | String filename = "test"; 14 | String fileext = ".jpg"; 15 | String foldername = "./"; 16 | 17 | int max_display_size = 800; // viewing window size (regardless image size) 18 | 19 | // logic starts here 20 | boolean started = false; 21 | int[] fx; 22 | int[] fy; 23 | 24 | float[] phx; 25 | float[] phy; 26 | 27 | int[] sx,sy; 28 | 29 | boolean[] skipfx; 30 | boolean[] skipfy; 31 | 32 | boolean dox,doy; 33 | 34 | PImage img; 35 | 36 | float[][] ft = new float[2][32]; 37 | 38 | int depth; // number of octaves 39 | 40 | // working buffer 41 | PGraphics buffer; 42 | 43 | String sessionid; 44 | 45 | void setup() { 46 | sessionid = hex((int)random(0xffff),4); 47 | img = loadImage(foldername+filename+fileext); 48 | 49 | buffer = createGraphics(img.width, img.height); 50 | buffer.beginDraw(); 51 | buffer.noStroke(); 52 | buffer.fill(255); 53 | buffer.background(0); 54 | buffer.endDraw(); 55 | 56 | // calculate window size 57 | float ratio = (float)img.width/(float)img.height; 58 | int neww, newh; 59 | if(ratio < 1.0) { 60 | neww = (int)(max_display_size * ratio); 61 | newh = max_display_size; 62 | } else { 63 | neww = max_display_size; 64 | newh = (int)(max_display_size / ratio); 65 | } 66 | 67 | surface.setResizable(true); 68 | surface.setSize(neww, newh); 69 | 70 | for(int i=0;i<32;i++) { 71 | ft[0][i] = pow(2.0,i); 72 | ft[1][i] = 0.5*1.0/ft[0][i]; 73 | } 74 | 75 | int s = img.width>img.height?img.height:img.width; 76 | depth = (int)(log(s)/log(2)); 77 | } 78 | 79 | void drawBuffer() { 80 | buffer.beginDraw(); 81 | int fxnum = (int)random(depth); 82 | int fynum = (int)random(depth); 83 | 84 | fx = new int[fxnum+1]; 85 | fy = new int[fynum+1]; 86 | sx = new int[fxnum+1]; 87 | sy = new int[fynum+1]; 88 | 89 | phx = new float[fxnum+1]; 90 | phy = new float[fynum+1]; 91 | 92 | skipfx = new boolean[fxnum+1]; 93 | skipfy = new boolean[fynum+1]; 94 | 95 | for(int i=0;i5?channel-6:channel; 201 | float cc; 202 | 203 | switch(ch) { 204 | case RED: cc = red(c); break; 205 | case GREEN: cc = green(c); break; 206 | case BLUE: cc = blue(c); break; 207 | case HUE: cc = hue(c); break; 208 | case SATURATION: cc = saturation(c); break; 209 | default: cc= brightness(c); break; 210 | } 211 | 212 | return channel>5?255-cc:cc; 213 | } 214 | -------------------------------------------------------------------------------- /PROCESSING 3/ultimateSort/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/ultimateSort/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/ultimateSort/test/res_43D4F76F_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/ultimateSort/test/res_43D4F76F_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/ultimateSort/test/res_D16C8172_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/ultimateSort/test/res_D16C8172_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/bl/bl1000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/bl/bl1000.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/bl/bl1001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/bl/bl1001.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/bl/bl1002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/bl/bl1002.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/bl/bl1003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/bl/bl1003.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/bl/bl1004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/bl/bl1004.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/bl/bl1005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/bl/bl1005.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0003.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0004.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0005.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0006.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0007.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0008.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0009.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/nyt/NYTimes-Dec1900-Jan1901_0010.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/test/res_00CB832B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/test/res_00CB832B_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/watmap/test/res_7CAE6A7A_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/watmap/test/res_7CAE6A7A_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wavelets/code/JWave.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wavelets/code/JWave.jar -------------------------------------------------------------------------------- /PROCESSING 3/wavelets/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wavelets/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wavelets/test/res_A29820C2_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wavelets/test/res_A29820C2_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wavelets/test/res_A298612B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wavelets/test/res_A298612B_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wavelets/test/res_A2986DB5_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wavelets/test/res_A2986DB5_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wavelets/test/res_A2989237_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wavelets/test/res_A2989237_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wrongqsort/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wrongqsort/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wrongqsort/test/res_7B682694_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wrongqsort/test/res_7B682694_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wrongqsort/test/res_7B684217_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wrongqsort/test/res_7B684217_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wrongqsort/test/res_7B6873D4_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wrongqsort/test/res_7B6873D4_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wrongqsort/wrongqsort.pde: -------------------------------------------------------------------------------- 1 | // Wrong QuickSort algorithm 2 | // Based on following code by Mick Kellogg, http://www.openprocessing.org/sketch/53609 3 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 4 | // Licence: CC-BY-SA 5 | 6 | // Usage: 7 | // * press SPACE to save 8 | // * click to change mode 9 | // * move mouse to choose line size to sort (length equals x*y) 10 | // - top-left region - short lines 11 | // - middle - long, bigger parts of image 12 | 13 | // set up filename 14 | String filename = "test"; 15 | String fileext = ".jpg"; 16 | String foldername = "./"; 17 | 18 | int max_display_size = 800; // viewing window size (regardless image size) 19 | 20 | boolean mode = L; // L or R, which sort part is broken 21 | 22 | boolean do_blend = false; // blend image after process 23 | int blend_mode = OVERLAY; // blend type 24 | 25 | static final boolean L = true; 26 | static final boolean R = false; 27 | 28 | // working buffer 29 | PGraphics buffer; 30 | 31 | // image 32 | PImage img; 33 | 34 | String sessionid; 35 | 36 | void setup() { 37 | sessionid = hex((int)random(0xffff),4); 38 | img = loadImage(foldername+filename+fileext); 39 | 40 | buffer = createGraphics(img.width, img.height); 41 | buffer.beginDraw(); 42 | buffer.noStroke(); 43 | buffer.smooth(8); 44 | buffer.background(0); 45 | buffer.image(img,0,0); 46 | buffer.endDraw(); 47 | 48 | // calculate window size 49 | float ratio = (float)img.width/(float)img.height; 50 | int neww, newh; 51 | if(ratio < 1.0) { 52 | neww = (int)(max_display_size * ratio); 53 | newh = max_display_size; 54 | } else { 55 | neww = max_display_size; 56 | newh = (int)(max_display_size / ratio); 57 | } 58 | 59 | surface.setSize(neww, newh); 60 | 61 | len = img.width * img.height; 62 | processImage((int)random(len-1)+1); 63 | } 64 | 65 | int len; 66 | 67 | void draw() { 68 | float x = map(mouseX, 0, width-1,0,1); 69 | float y = map(mouseY, 0, height-1,0,1); 70 | int vall = (int)map(x*y,0,1,1,len-1); 71 | processImage(vall); 72 | } 73 | 74 | float random_point = 0.5; 75 | void mouseMoved() { 76 | random_point = random(0.1,0.9); 77 | } 78 | 79 | void processImage(int v) { 80 | buffer.beginDraw(); 81 | buffer.image(img,0,0); 82 | buffer.endDraw(); 83 | 84 | buffer.loadPixels(); 85 | 86 | int x = 0; 87 | while(x pivot) { 130 | j--; 131 | } 132 | if (i <= j) { 133 | temp = x[i]; 134 | x[i] = x [j]; 135 | x[j] = temp; 136 | i++; 137 | j--; 138 | } 139 | } 140 | return i; 141 | } 142 | 143 | void quicksort(int x[], int left, int right) { 144 | if(left index-1) quicksort(x, left, index-1); 151 | if(right > index) quicksort(x, index, right); 152 | } 153 | } 154 | } 155 | 156 | final static int[] blends = {ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN}; 157 | -------------------------------------------------------------------------------- /PROCESSING 3/wzipprocess2/res_0018_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wzipprocess2/res_0018_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wzipprocess2/res_0022_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wzipprocess2/res_0022_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wzipprocess2/res_0034_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wzipprocess2/res_0034_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wzipprocess2/res_0062_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wzipprocess2/res_0062_test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wzipprocess2/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/PROCESSING 3/wzipprocess2/test.jpg -------------------------------------------------------------------------------- /PROCESSING 3/wzipprocess2/wzipprocess2.pde: -------------------------------------------------------------------------------- 1 | // wzip - a preprocessor for lossy data compression, originally: Copyright (C) 1997 Andreas Franzen 2 | // Processing port, Tomasz Sulej, generateme.blog@gmail.com 3 | // Haar wavelet transformation to glitch your raw images, operates on bytes, use different scaling factors (see below) 4 | 5 | // Licence GNU GPL 2.0 6 | 7 | // move mouse around the image 8 | // * press ENTER/RETURN to change scale for scaling factors 9 | // * press SPACE to toggle between RGBRGB... (HSBHSB...) or RRR...GGG...BBB... (HHH...SSS...BBB...) raws 10 | // * click to save 11 | 12 | // filename 13 | String filename = "test"; 14 | String fileext = ".jpg"; 15 | String foldername = "./"; 16 | 17 | int max_display_size = 800; // viewing window size (regardless image size) 18 | 19 | boolean do_hsb = false; // do operate on HSB channels 20 | 21 | // logic below 22 | 23 | float scalingfactorin; 24 | float scalingfactorout; 25 | 26 | final static float sqrt05 = sqrt(0.5); 27 | 28 | float[] raw, raw1,raw2,raw3; 29 | float[] in, w, out; 30 | float[] in1,in2,in3,out1,out2,out3; 31 | int n,n2,s; 32 | 33 | boolean option1 = true; 34 | float sc = 160; 35 | 36 | PImage img; 37 | 38 | // working buffer 39 | PGraphics buffer; 40 | 41 | String sessionid; 42 | 43 | void setup() { 44 | sessionid = hex((int)random(0xffff),4); 45 | img = loadImage(foldername+filename+fileext); 46 | 47 | buffer = createGraphics(img.width, img.height); 48 | buffer.beginDraw(); 49 | buffer.background(0); 50 | buffer.noStroke(); 51 | buffer.endDraw(); 52 | 53 | // calculate window size 54 | float ratio = (float)img.width/(float)img.height; 55 | int neww, newh; 56 | if(ratio < 1.0) { 57 | neww = (int)(max_display_size * ratio); 58 | newh = max_display_size; 59 | } else { 60 | neww = max_display_size; 61 | newh = (int)(max_display_size / ratio); 62 | } 63 | 64 | surface.setSize(neww, newh); 65 | 66 | s = img.width*img.height; 67 | raw = new float[s*3]; 68 | raw1 = new float[s]; 69 | raw2 = new float[s]; 70 | raw3 = new float[s]; 71 | 72 | if(do_hsb) colorMode(HSB,255); else colorMode(RGB,255); 73 | 74 | int iter=0; 75 | int iter2 = 0; 76 | for(int y=0;y127?hue(c)-256:hue(c); 82 | g = saturation(c)>127?saturation(c)-256:saturation(c); 83 | b = brightness(c)>127?brightness(c)-256:brightness(c); 84 | } else { 85 | r = red(c)>127?red(c)-256:red(c); 86 | g = green(c)>127?green(c)-256:green(c); 87 | b = blue(c)>127?blue(c)-256:blue(c); 88 | } 89 | raw[iter++] = r; 90 | raw[iter++] = g; 91 | raw[iter++] = b; 92 | raw1[iter2] = r; 93 | raw2[iter2] = g; 94 | raw3[iter2] = b; 95 | iter2++; 96 | } 97 | } 98 | 99 | n = (int)pow(2,ceil(log(s*3)/log(2))); 100 | n2 = (int)pow(2,ceil(log(s)/log(2))); 101 | 102 | in = new float[n]; 103 | w = new float[n]; 104 | out = new float[n]; 105 | out1 = new float[n2]; 106 | out2 = new float[n2]; 107 | out3 = new float[n2]; 108 | in1 = new float[n2]; 109 | in2 = new float[n2]; 110 | in3 = new float[n2]; 111 | 112 | arrayCopy(raw,0,in,0,raw.length); 113 | for(int i=raw.length;i// 198 | } 199 | if(option1) println("channels combined: " + str1); 200 | else println("channels separated: " + str2); 201 | } 202 | 203 | void printScale() { 204 | println("Scale: 0.."+sc); 205 | } 206 | 207 | void keyPressed() { 208 | if(keyCode == 32) { 209 | option1 = !option1; 210 | printOption(); 211 | } else if(keyCode == ENTER || keyCode == RETURN) { 212 | if(sc < 10) sc = 10; 213 | else if(sc<100) sc *=2; 214 | else if(sc<1000) sc+=200; 215 | else sc = 1; 216 | printScale(); 217 | } 218 | } 219 | 220 | void mouseClicked() { 221 | buffer.save(foldername + filename + "/res_" + sessionid + hex((int)random(0xffff),4)+"_"+filename+fileext); 222 | println("image saved"); 223 | } 224 | 225 | void wbtrafo(float[] y, int n) { 226 | float[] d = new float[n]; 227 | d[n-2] = w[n-1]; 228 | int b1 = n-4; 229 | int b2 = n-2; 230 | int a=1; 231 | while(a0) { 260 | for(int i=0;i0) w[n-1] = (int)(w[n-1]/scalingfactorin+0.5); 272 | else w[n-1] = (int)(w[n-1]/scalingfactorin-0.5); 273 | } 274 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **WARNING! Latest Processing 2 only! Looking for Processing 3 versions? [See below](#processing-3).** 2 | 3 | # GenerateMe 4 | Processing scripts used to generative glitch / art / design 5 | 6 | * http://generateme.tumblr.com 7 | * https://github.com/Clojure2D/clojure2d 8 | 9 | generateme.blog@gmail.com 10 | 11 | clone recursively ```git clone --recursive https://github.com/tsulej/GenerateMe.git``` 12 | 13 | Detailed instructions inside scripts, examples included. 14 | 15 | **WARNING! Latest Processing 2 only! Looking for Processing 3 versions? [See below](#processing-3).** 16 | 17 | ## Tutorials 18 | 19 | * FM tutorial by [Moon-Harpy](https://www.moonharpyproject.ie/) - https://www.youtube.com/watch?v=Gi4ce5DTWks 20 | 21 | ## Scripts 22 | 23 | * decayscreen - decay image, based on XScreenSaver hack with the same name 24 | * drawing_generative - draw image using strokes based on channel value 25 | * drawing_strokes - draw image using lines (aka robot drawing) 26 | * fractalify - draw mandelbrot/julia fractals using channel data from image 27 | * imagelens - use image channel data to displace pixels. You can use different image as lens and to process. 28 | * mirrorimage - mirror parts of the image to other parts, 24 modes for rectangular (12 for squared) images 29 | * ntsc_analogtv - xanalogtv XScreenSaver hack ported to processing 30 | * slitscan - simulate errors during scanning (more digital way) 31 | * wzipprocess2 - recompress image using wzip method (Haar wavelet transformation) 32 | * imageslicer - few algorithms based on segmentation of the image 33 | * cutsort - cut image to lines of random length, sort (or not) and encode image, decode to get glitched result 34 | * distorter - another way to pixel displacement 35 | * lz77 - two script to compress/decompress image/binary with random glitch compressed data 36 | * median_filter - median filter with option to choose other points (not only median) 37 | * wrongqsort - cut image to lines/parts and use buggy QuickSort to sort pixels 38 | * wavelets - wavelet compression tool 39 | * pngglitch - corrupt PNG files (using hacked decoder) 40 | * ultimateSort - partly sort thresholded pixels with various algorithms 41 | * moire - random moire patterns generator / simulator 42 | * pix2line - convert pixels into lines snapped to noise grid 43 | * pixeldrifter - drift pixels using channel data 44 | * watmap - divide target image into regions and map with most matching part from source set 45 | * blendimages - blend source image set into target 46 | * threadraw - draw vertical threads based on image (similar to generative draw) 47 | * decompose_paint - decompose image into sqares/rectangles and fill it with some pattern 48 | * imsyntex - reconstruct image using texture synthesis algorithm 49 | * fm - frequency modulation and demodulation 50 | * composite_video_simulator - very precise VHS/Composite Video/Tape simulation, based on: https://github.com/joncampbell123/composite-video-simulator 51 | * Obj2Raw - convert OBJ vertex data to RAW 8 bit signed (for sonification purposes) 52 | * granularresynth - Granular (re)synthesis of any RAW using other RAWs for visual/audio 53 | * -> sonification - image sonification 54 | * -> GLIC - glitch image codec 55 | * TEMPLATE - clean template sketch with some predefined functions 56 | 57 | ## Processing 3 58 | 59 | In order to have scripts working in Processing 3 change (thanks to *Aitor*): 60 | 61 | * ```size()``` to ```surface.setSize()``` 62 | * ```sketchPath``` to ```sketchPath()``` 63 | * ```buffer.loadPixels()``` must be called after ```buffer.beginDraw()``` 64 | * Calling a function that draws from the buffer into the window needs to be done in ```draw()``` 65 | 66 | Some of them are ported by: 67 | 68 | https://github.com/wabisabit: 69 | 70 | * blendimages 71 | * decayscreen 72 | * Obj2Raw 73 | * pixeldrifter 74 | * pngglitch 75 | * slitscan 76 | 77 | https://github.com/philhudson91: 78 | 79 | * threadraw 80 | * ultimateSort 81 | * watmap 82 | * wavelets 83 | * wrongqsort 84 | * wzipprocess2 85 | 86 | Pull request welcome!!! 87 | 88 | ## Donation 89 | 90 | Actually I don't need financial aid (hey, it's a hobby project I really enjoy). But! There is a disabled kid in my family (unfortunate chromosom 14 deletion) which requires constant support. If you wish to spend some money and make Anthony's (that's his name) life better, that's the best thing you can do. Thank you in advance. 91 | 92 | The charity organization which looks after him is: https://dzieciom.pl/o-fundacji/english 93 | 94 | Anthony's profile: https://dzieciom.pl/podopieczni/28200 95 | 96 | If you want make a transfer here is the info (https://dzieciom.pl/chce-pomoc): 97 | 98 | * Transfer title (most important): 28200 Antoni Kosciukiewicz 99 | * SWIFT/BIC: ALBPPLPW 100 | * Currency: 101 | * EUR: PL 82 2490 0005 0000 4600 7337 4309 102 | * USD: PL 90 2490 0005 0000 4530 9858 4994 103 | * GBP: PL 28 2490 0005 0000 4600 6246 8310 104 | * PLN: PL 42 2490 0005 0000 4600 7549 3994 105 | 106 | -------------------------------------------------------------------------------- /TEMPLATE/TEMPLATE.pde: -------------------------------------------------------------------------------- 1 | // Template for processing scripts 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | 8 | // set up filename 9 | String filename = "test"; 10 | String fileext = ".jpg"; 11 | String foldername = "./"; 12 | 13 | int max_display_size = 1000; // viewing window size (regardless image size) 14 | 15 | boolean do_blend = false; // blend image after process 16 | int blend_mode = OVERLAY; // blend type 17 | 18 | // working buffer 19 | PGraphics buffer; 20 | 21 | // image 22 | PImage img; 23 | 24 | String sessionid; 25 | 26 | void setup() { 27 | sessionid = hex((int)random(0xffff),4); 28 | img = loadImage(foldername+filename+fileext); 29 | 30 | buffer = createGraphics(img.width, img.height); 31 | buffer.beginDraw(); 32 | buffer.noStroke(); 33 | buffer.smooth(8); 34 | buffer.background(0); 35 | buffer.image(img,0,0); 36 | buffer.endDraw(); 37 | 38 | // calculate window size 39 | float ratio = (float)img.width/(float)img.height; 40 | int neww, newh; 41 | if(ratio < 1.0) { 42 | neww = (int)(max_display_size * ratio); 43 | newh = max_display_size; 44 | } else { 45 | neww = max_display_size; 46 | newh = (int)(max_display_size / ratio); 47 | } 48 | 49 | size(neww,newh); 50 | 51 | processImage(); 52 | } 53 | 54 | void draw() { 55 | // fill for iterative processing 56 | } 57 | 58 | void processImage() { 59 | buffer.beginDraw(); 60 | 61 | // START CODE HERE! use buffer to draw/manipulate 62 | 63 | for(int x=0;x rgb 66 | color c = img.get(x,y); 67 | buffer.fill( hue(c), saturation(c), brightness(c) ); 68 | buffer.rect(x,y,1,1); 69 | } 70 | } 71 | 72 | // END CODE HERE! 73 | 74 | if(do_blend) 75 | buffer.blend(img,0,0,img.width,img.height,0,0,buffer.width,buffer.height,blend_mode); 76 | 77 | buffer.endDraw(); 78 | image(buffer,0,0,width,height); 79 | } 80 | 81 | void keyPressed() { 82 | // SPACE to save 83 | if(keyCode == 32) { 84 | String fn = foldername + filename + "/res_" + sessionid + hex((int)random(0xffff),4)+"_"+filename+fileext; 85 | buffer.save(fn); 86 | println("Image "+ fn + " saved"); 87 | } 88 | } 89 | 90 | // 91 | 92 | final static int[] blends = {ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN}; 93 | 94 | // ALL Channels, Nxxx stand for negative (255-value) 95 | // channels to work with 96 | final static int RED = 0; 97 | final static int GREEN = 1; 98 | final static int BLUE = 2; 99 | final static int HUE = 3; 100 | final static int SATURATION = 4; 101 | final static int BRIGHTNESS = 5; 102 | final static int NRED = 6; 103 | final static int NGREEN = 7; 104 | final static int NBLUE = 8; 105 | final static int NHUE = 9; 106 | final static int NSATURATION = 10; 107 | final static int NBRIGHTNESS = 11; 108 | 109 | float getChannel(color c, int channel) { 110 | int ch = channel>5?channel-6:channel; 111 | float cc; 112 | 113 | switch(ch) { 114 | case RED: cc = red(c); break; 115 | case GREEN: cc = green(c); break; 116 | case BLUE: cc = blue(c); break; 117 | case HUE: cc = hue(c); break; 118 | case SATURATION: cc = saturation(c); break; 119 | default: cc= brightness(c); break; 120 | } 121 | 122 | return channel>5?255-cc:cc; 123 | } 124 | -------------------------------------------------------------------------------- /TEMPLATE/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/TEMPLATE/test.jpg -------------------------------------------------------------------------------- /blendimages/bl/bl1000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/bl/bl1000.jpg -------------------------------------------------------------------------------- /blendimages/bl/bl1001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/bl/bl1001.jpg -------------------------------------------------------------------------------- /blendimages/bl/bl1002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/bl/bl1002.jpg -------------------------------------------------------------------------------- /blendimages/bl/bl1003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/bl/bl1003.jpg -------------------------------------------------------------------------------- /blendimages/bl/bl1004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/bl/bl1004.jpg -------------------------------------------------------------------------------- /blendimages/bl/bl1005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/bl/bl1005.jpg -------------------------------------------------------------------------------- /blendimages/blendimages.pde: -------------------------------------------------------------------------------- 1 | // Blend images with a target 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | // * click for random change of parameters 8 | 9 | // set up filename of the target 10 | String filename = "test"; 11 | String fileext = ".jpg"; 12 | String foldername = "./"; 13 | 14 | // how to blend COLOR or channel VALUE? 15 | int mode = BLEND_COLOR; // BLEND_VALUE or BLEND_COLOR 16 | // if channel VALUE set what channel 17 | int VALUE_FOR_BLEND = BRIGHTNESS; // only if BLEND_VALUE chosen 18 | 19 | // do you want random number of source used 20 | boolean random_source = false; 21 | 22 | int max_display_size = 1000; // viewing window size (regardless image size) 23 | 24 | boolean do_blend = false; // blend image after process 25 | int blend_mode = OVERLAY; // blend type 26 | 27 | // set up source image set 28 | // using below variables filenames from the set are constructed 29 | // example: my images have names: bl1000.jpg, bl1001.jpg etc... 30 | // and are located in 'bl/' folder 31 | // I have 6 of them, with constant prefix: "bl/bl100" (pattern_prefix) 32 | // then every file has one sequence digit from 0 to 5 (pattern_init and pattern_length) 33 | // with 'pattern_size' digits for the sequence (here: one digit) 34 | // at the end 'file_ext' is added 35 | // below setting produce six names: bl/bl1000.jpg, bl/bl1001.jpg, bl/bl1002.jpg, bl/bl1003.jpg, bl/bl1004.jpg, bl/bl1005.jpg 36 | final static String pattern_prefix = "bl/bl100"; 37 | final static String file_ext = ".jpg"; 38 | final static int pattern_init = 0; // starting number 39 | final static int pattern_length = 6; // how many images from the set, don't use more than 10 40 | final static int pattern_size = 1; // number of digits 41 | 42 | final static int BLEND_COLOR = 0; 43 | final static int BLEND_VALUE = 1; 44 | 45 | // working buffer 46 | PGraphics buffer; 47 | 48 | // image 49 | PImage img; 50 | 51 | String sessionid; 52 | 53 | PImage[] sset = new PImage[pattern_length]; 54 | 55 | void setup() { 56 | sessionid = hex((int)random(0xffff), 4); 57 | img = loadImage(foldername+filename+fileext); 58 | img.loadPixels(); 59 | 60 | buffer = createGraphics(img.width, img.height); 61 | buffer.loadPixels(); 62 | 63 | // calculate window size 64 | float ratio = (float)img.width/(float)img.height; 65 | int neww, newh; 66 | if (ratio < 1.0) { 67 | neww = (int)(max_display_size * ratio); 68 | newh = max_display_size; 69 | } else { 70 | neww = max_display_size; 71 | newh = (int)(max_display_size / ratio); 72 | } 73 | 74 | size(neww, newh); 75 | 76 | for (int i=0; i> 16) &0xff; 103 | v.y = (c >> 8) &0xff; 104 | v.z = c &0xff; 105 | return v; 106 | } 107 | 108 | void processImage() { 109 | 110 | 111 | int[] idx = new int[pattern_length]; 112 | for (int i=0; i5?channel-6:channel; 195 | float cc; 196 | 197 | switch(ch) { 198 | case RED: 199 | cc = red(c); 200 | break; 201 | case GREEN: 202 | cc = green(c); 203 | break; 204 | case BLUE: 205 | cc = blue(c); 206 | break; 207 | case HUE: 208 | cc = hue(c); 209 | break; 210 | case SATURATION: 211 | cc = saturation(c); 212 | break; 213 | default: 214 | cc= brightness(c); 215 | break; 216 | } 217 | 218 | return channel>5?255-cc:cc; 219 | } 220 | 221 | -------------------------------------------------------------------------------- /blendimages/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/test.jpg -------------------------------------------------------------------------------- /blendimages/test/res_301E1771_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/test/res_301E1771_test.jpg -------------------------------------------------------------------------------- /blendimages/test/res_301ECD7B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/test/res_301ECD7B_test.jpg -------------------------------------------------------------------------------- /blendimages/test/res_301EFDA1_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/blendimages/test/res_301EFDA1_test.jpg -------------------------------------------------------------------------------- /composite_video_simulator/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/composite_video_simulator/test.jpg -------------------------------------------------------------------------------- /composite_video_simulator/test/res_3757BA36_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/composite_video_simulator/test/res_3757BA36_test.jpg -------------------------------------------------------------------------------- /composite_video_simulator/test/res_A0DC39B8_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/composite_video_simulator/test/res_A0DC39B8_test.jpg -------------------------------------------------------------------------------- /composite_video_simulator/test/res_F9E501BD_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/composite_video_simulator/test/res_F9E501BD_test.jpg -------------------------------------------------------------------------------- /cutsort/code/gson-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/cutsort/code/gson-2.3.1.jar -------------------------------------------------------------------------------- /cutsort/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/cutsort/test.jpg -------------------------------------------------------------------------------- /cutsort/test/_test_encoded1450.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/cutsort/test/_test_encoded1450.jpg -------------------------------------------------------------------------------- /cutsort/test/res_1450EB39_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/cutsort/test/res_1450EB39_test.jpg -------------------------------------------------------------------------------- /cutsort/test/test_encoded1450.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/cutsort/test/test_encoded1450.jpg -------------------------------------------------------------------------------- /decayscreen/decayscreen.pde: -------------------------------------------------------------------------------- 1 | // Decay image 2 | // Original source: xscreensaver 5.32, authors: David Wald (1988), Vivek Khera (1993), JWZ (1997), R. Schultz (1999) 3 | // Not exact port to Processing, Tomasz Sulej, generateme.blog@gmail.com, 2015 4 | // Licence at the end of file 5 | 6 | // Set file name 7 | // press: i - to change drag method between in/out 8 | // SPACE - to save 9 | // ENTER - to decay automaticly 10 | // drag clicked mouse to decay in or out 11 | 12 | String filename = "test"; 13 | String fileext = ".jpg"; 14 | String foldername = "./"; 15 | 16 | int max_display_size = 800; // viewing window size (regardless image size) 17 | 18 | // 19 | 20 | PImage img; 21 | 22 | // working buffer 23 | PGraphics buffer; 24 | 25 | String sessionid; 26 | 27 | void setup() { 28 | sessionid = hex((int)random(0xffff),4); 29 | img = loadImage(foldername+filename+fileext); 30 | 31 | buffer = createGraphics(img.width, img.height); 32 | buffer.image(img,0,0); 33 | 34 | // calculate window size 35 | float ratio = (float)img.width/(float)img.height; 36 | int neww, newh; 37 | if(ratio < 1.0) { 38 | neww = (int)(max_display_size * ratio); 39 | newh = max_display_size; 40 | } else { 41 | neww = max_display_size; 42 | newh = (int)(max_display_size / ratio); 43 | } 44 | 45 | size(neww,newh); 46 | frameRate(100); 47 | 48 | printStats(); 49 | } 50 | 51 | boolean auto = true; 52 | 53 | void draw() { 54 | buffer.beginDraw(); 55 | if(auto) doDecay(); 56 | buffer.endDraw(); 57 | image(buffer,0,0,width,height); 58 | } 59 | 60 | boolean in = true; 61 | 62 | void mouseDragged() { 63 | noLoop(); 64 | buffer.beginDraw(); 65 | doBias(in,(int)map(mouseX,0,width,0,img.width),(int)map(mouseY,0,height,0,img.height)); 66 | buffer.endDraw(); 67 | image(buffer,0,0,width,height); 68 | loop(); 69 | } 70 | 71 | void keyPressed() { 72 | if(key == 'i') in = !in; 73 | if(keyCode == RETURN || keyCode == ENTER) auto = !auto; 74 | if(keyCode == 32) { buffer.save(foldername + filename + "/res_" + sessionid + hex((int)random(0xffff),4)+"_"+filename+fileext); print("saved... "); }; 75 | printStats(); 76 | } 77 | 78 | void printStats() { 79 | println("method: " + (in?"in":"out") + "; "+(auto?"auto":"")); 80 | } 81 | 82 | void doDecay() { 83 | int a = (random(1)<0.05)?(int)random(6):(int)random(2); 84 | switch(a) { 85 | case 0: doBias(); break; 86 | case 1: doFuzz(); break; 87 | case 2: doStretchV(); break; 88 | case 3: doSqueezeV(); break; 89 | case 4: doStretchH(); break; 90 | case 5: doSqueezeV(); break; 91 | default: doBias(); 92 | } 93 | } 94 | 95 | static final int L = 0; 96 | static final int R = 1; 97 | static final int U = 2; 98 | static final int D = 3; 99 | 100 | static final int[][] bias = { 101 | { L,L,L,L, R,R,R,R, U,U,U,U, D,D,D,D }, 102 | { L,L,L,L, R,R,R,R, U,U,U,U, U,U,D,D }, 103 | { L,L,L,L, R,R,R,R, U,U,D,D, D,D,D,D }, 104 | { L,L,L,L, L,L,R,R, U,U,U,U, D,D,D,D }, 105 | { L,L,R,R, R,R,R,R, U,U,U,U, D,D,D,D }, 106 | 107 | { L,L,L,L, L,L,L,R, U,U,U,U, U,U,U,D }, 108 | { L,L,L,L, L,L,L,R, U,D,D,D, D,D,D,D }, 109 | { L,R,R,R, R,R,R,R, U,U,U,U, U,U,U,D }, 110 | { L,R,R,R, R,R,R,R, U,D,D,D, D,D,D,D } 111 | }; 112 | 113 | void doBias(boolean in, int mx, int my) { 114 | int left = (int)random(img.width-1); 115 | int top = (int)random(img.height); 116 | int w = (int)random(img.width-left); 117 | int h = (int)random(img.height-top); 118 | int toleft = left; 119 | int totop = top; 120 | 121 | int biasno = 0; 122 | 123 | if(in) { 124 | if (top>my && left>mx) biasno = 5; 125 | else if (top>my && leftmx) biasno = 6; 127 | else biasno = 8; 128 | } else { 129 | if (top>my && left>mx) biasno = 8; 130 | else if (top>my && leftmx) biasno = 7; 132 | else biasno = 5; 133 | } 134 | 135 | switch( bias[biasno][(int)random(16)] ) { 136 | case L: {toleft = left-2;break;} 137 | case R: {toleft = left+2;break;} 138 | case U: {totop = top-2;break;} 139 | case D: {totop = top+2; break;} 140 | default: {toleft = left-1; totop=top+1;}break; 141 | } 142 | 143 | PImage timg = buffer.get(left,top,w,h); 144 | buffer.image(timg,toleft,totop); 145 | } 146 | 147 | void doBias() { 148 | int left = (int)random(img.width-1); 149 | int top = (int)random(img.height); 150 | int w = (int)random(img.width-left); 151 | int h = (int)random(img.height-top); 152 | int toleft = left; 153 | int totop = top; 154 | 155 | switch( bias[(int)random(9)][(int)random(16)] ) { 156 | case L: {toleft = left-1;break;} 157 | case R: {toleft = left+1;break;} 158 | case U: {totop = top-1;break;} 159 | case D: {totop = top+1; break;} 160 | default: {toleft = left-1; totop=top+1;}break; 161 | } 162 | 163 | PImage timg = buffer.get(left,top,w,h); 164 | buffer.image(timg,toleft,totop); 165 | } 166 | 167 | boolean fuzz_toggle = true; 168 | void doFuzz() { 169 | int left = (int)random(img.width-1); 170 | int top = (int)random(img.height-1); 171 | int h,w,totop,toleft; 172 | 173 | // bad code, bad... 174 | if(fuzz_toggle) { 175 | totop = top; 176 | h = 1; 177 | toleft = (int)random(img.width-1); 178 | if(toleft>left) { 179 | w = toleft-left; 180 | toleft = left; 181 | left++; 182 | } else { 183 | w = left-toleft; 184 | left = toleft; 185 | toleft++; 186 | } 187 | } else { 188 | toleft = left; 189 | w = 1; 190 | totop = (int)random(img.height-1); 191 | if(totop>top) { 192 | h = totop-top; 193 | totop = top; 194 | top++; 195 | } else { 196 | h = top-totop; 197 | top = totop; 198 | totop++; 199 | } 200 | } 201 | fuzz_toggle = !fuzz_toggle; 202 | 203 | PImage timg = buffer.get(left,top,w,h); 204 | buffer.image(timg,toleft,totop); 205 | } 206 | 207 | void doStretchV() { 208 | int top = (int)random(img.height); 209 | 210 | PImage timg = buffer.get(0,img.height-top-2,img.width,top+1); 211 | buffer.image(timg,0,img.height-top-1); 212 | } 213 | 214 | void doSqueezeV() { 215 | int top = (int)random(img.height); 216 | 217 | PImage timg = buffer.get(0,img.height-top-1,img.width,top+1); 218 | buffer.image(timg,0,img.height-top-2); 219 | } 220 | 221 | void doStretchH() { 222 | int left = (int)random(img.width); 223 | 224 | PImage timg = buffer.get(img.width-left-2,0,left+1,img.height); 225 | buffer.image(timg,img.width-left-1,0); 226 | } 227 | 228 | void doSqueezeH() { 229 | int left = (int)random(img.width); 230 | 231 | PImage timg = buffer.get(img.width-left-1,0,left+1,img.height); 232 | buffer.image(timg,img.width-left-2,0); 233 | } 234 | 235 | /* 236 | * Permission to use, copy, modify, distribute, and sell this software and its 237 | * documentation for any purpose is hereby granted without fee, provided that 238 | * the above copyright notice appear in all copies and that both that 239 | * copyright notice and this permission notice appear in supporting 240 | * documentation. No representations are made about the suitability of this 241 | * software for any purpose. It is provided "as is" without express or 242 | * implied warranty. 243 | */ 244 | -------------------------------------------------------------------------------- /decayscreen/res_74230_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/decayscreen/res_74230_test.jpg -------------------------------------------------------------------------------- /decayscreen/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/decayscreen/test.jpg -------------------------------------------------------------------------------- /decompose_paint/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/decompose_paint/test.jpg -------------------------------------------------------------------------------- /decompose_paint/test/res_852985E3_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/decompose_paint/test/res_852985E3_test.jpg -------------------------------------------------------------------------------- /decompose_paint/test/res_85299ABC_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/decompose_paint/test/res_85299ABC_test.jpg -------------------------------------------------------------------------------- /decompose_paint/test/res_8529C4BC_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/decompose_paint/test/res_8529C4BC_test.jpg -------------------------------------------------------------------------------- /distorter/distorter.pde: -------------------------------------------------------------------------------- 1 | // Distortion of the image based on vvvv shader from glitchpack, http://vvvv.org/contribution/acid-glitch-shaders by idvyr 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | // * move mouse around image 8 | 9 | // set up filename 10 | String filename = "test"; 11 | String fileext = ".jpg"; 12 | String foldername = "./"; 13 | 14 | int max_display_size = 1000; // viewing window size (regardless image size) 15 | 16 | boolean do_blend = false; // blend image after process 17 | int blend_mode = OVERLAY; // blend type 18 | int channel = BRIGHTNESS; // channel used in processing (R,G,B) or (H,S,B) 19 | float scalex = 0.05; // from 0.01 to 1 20 | float scaley = 0.1; // from 0.01 to 1 21 | boolean shift_hue = true; 22 | float shift_amt = 0.1; // from 0 to 1 23 | 24 | // working buffer 25 | PGraphics buffer; 26 | 27 | // image 28 | PImage img; 29 | 30 | String sessionid; 31 | 32 | void setup() { 33 | sessionid = hex((int)random(0xffff),4); 34 | img = loadImage(foldername+filename+fileext); 35 | 36 | buffer = createGraphics(img.width, img.height); 37 | buffer.beginDraw(); 38 | buffer.noStroke(); 39 | buffer.smooth(8); 40 | buffer.background(0); 41 | buffer.image(img,0,0); 42 | buffer.endDraw(); 43 | 44 | // calculate window size 45 | float ratio = (float)img.width/(float)img.height; 46 | int neww, newh; 47 | if(ratio < 1.0) { 48 | neww = (int)(max_display_size * ratio); 49 | newh = max_display_size; 50 | } else { 51 | neww = max_display_size; 52 | newh = (int)(max_display_size / ratio); 53 | } 54 | 55 | size(neww,newh); 56 | 57 | // prepare distortion pattern 58 | for(int i=0;i<512;i++) { 59 | distort[0][i] = (int)random(-128,128); 60 | distort[1][i] = (int)random(-128,128); 61 | } 62 | 63 | } 64 | 65 | int[][] distort = new int[2][512]; 66 | final static float tick = 1.0/512.0; 67 | 68 | void draw() { 69 | processImage(); 70 | } 71 | 72 | void randomMe() { 73 | do_blend = random(1)<0.1; 74 | blend_mode = blends[(int)random(blends.length)]; 75 | channel = (int)random(12); 76 | scalex = random(1)<0.7?random(0.01,0.1):random(1); 77 | scaley = random(1)<0.7?random(0.05,0.2):random(1); 78 | shift_hue = random(1)<0.3; 79 | shift_amt = random(0.7); 80 | } 81 | 82 | void processImage() { 83 | float neww = map(mouseX,0,width,1,img.width/4); 84 | float newh = map(mouseY,0,height,1,img.height/4); 85 | 86 | float totalnum = neww+newh; 87 | float times = (totalnum/floor(totalnum/neww)); 88 | float offx = (totalnum%neww)/times; 89 | float ratiox = neww/img.width; 90 | 91 | buffer.beginDraw(); 92 | 93 | for(int y=0;y5?channel-6:channel; 168 | float cc; 169 | 170 | switch(ch) { 171 | case RED: cc = red(c); break; 172 | case GREEN: cc = green(c); break; 173 | case BLUE: cc = blue(c); break; 174 | case HUE: cc = hue(c); break; 175 | case SATURATION: cc = saturation(c); break; 176 | default: cc= brightness(c); break; 177 | } 178 | 179 | return channel>5?255-cc:cc; 180 | } 181 | -------------------------------------------------------------------------------- /distorter/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/distorter/test.jpg -------------------------------------------------------------------------------- /distorter/test/res_B9083ACB_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/distorter/test/res_B9083ACB_test.jpg -------------------------------------------------------------------------------- /distorter/test/res_B9085B8B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/distorter/test/res_B9085B8B_test.jpg -------------------------------------------------------------------------------- /distorter/test/res_B9086BEA_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/distorter/test/res_B9086BEA_test.jpg -------------------------------------------------------------------------------- /distorter/test/res_B908C02B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/distorter/test/res_B908C02B_test.jpg -------------------------------------------------------------------------------- /drawing_generative/drawing_generative.pde: -------------------------------------------------------------------------------- 1 | // Original: http://www.openprocessing.org/sketch/145401 2 | // adaptation to images, Tomasz Sulej, generateme.blog@gmail.com 3 | // Licence CC-BY-SA 3.0 4 | 5 | // put image filename here: 6 | String filename = "test"; 7 | String fileext = ".jpg"; 8 | String foldername = "./"; 9 | 10 | // choose channel 11 | int channel = HUE; 12 | 13 | // run, after 30 iterations result will be saved automatically 14 | // or press SPACE 15 | 16 | int max_display_size = 800; // viewing window size (regardless image size) 17 | 18 | ///////////////////////////////////// 19 | 20 | // channels to work with 21 | final static int RED = 0; 22 | final static int GREEN = 1; 23 | final static int BLUE = 2; 24 | final static int HUE = 3; 25 | final static int SATURATION = 4; 26 | final static int BRIGHTNESS = 5; 27 | final static int NRED = 6; 28 | final static int NGREEN = 7; 29 | final static int NBLUE = 8; 30 | final static int NHUE = 9; 31 | final static int NSATURATION = 10; 32 | final static int NBRIGHTNESS = 11; 33 | 34 | int n=2000; 35 | float [] cx=new float[n]; 36 | float [] cy=new float[n]; 37 | 38 | PImage img; 39 | int len; 40 | 41 | // working buffer 42 | PGraphics buffer; 43 | 44 | String sessionid; 45 | 46 | void setup() { 47 | sessionid = hex((int)random(0xffff),4); 48 | img = loadImage(foldername+filename+fileext); 49 | 50 | buffer = createGraphics(img.width, img.height); 51 | buffer.beginDraw(); 52 | buffer.noFill(); 53 | buffer.smooth(8); 54 | buffer.strokeWeight(0.3); 55 | buffer.background(0); 56 | buffer.endDraw(); 57 | 58 | // calculate window size 59 | float ratio = (float)img.width/(float)img.height; 60 | int neww, newh; 61 | if(ratio < 1.0) { 62 | neww = (int)(max_display_size * ratio); 63 | newh = max_display_size; 64 | } else { 65 | neww = max_display_size; 66 | newh = (int)(max_display_size / ratio); 67 | } 68 | 69 | size(neww,newh); 70 | 71 | len = (img.widthlen) { 95 | frameCount=0; 96 | println("iteration: " + tick++); 97 | for (int i=0;i5?channel-6:channel; 112 | float cc; 113 | 114 | switch(ch) { 115 | case RED: cc = red(c); break; 116 | case GREEN: cc = green(c); break; 117 | case BLUE: cc = blue(c); break; 118 | case HUE: cc = hue(c); break; 119 | case SATURATION: cc = saturation(c); break; 120 | default: cc= brightness(c); break; 121 | } 122 | 123 | return channel>5?255-cc:cc; 124 | } 125 | 126 | void keyPressed() { 127 | buffer.save(foldername + filename + "/res_" + sessionid + hex((int)random(0xffff),4)+"_"+filename+fileext); 128 | println("image saved"); 129 | } 130 | -------------------------------------------------------------------------------- /drawing_generative/res_40524_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_generative/res_40524_test.jpg -------------------------------------------------------------------------------- /drawing_generative/res_95922_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_generative/res_95922_test.jpg -------------------------------------------------------------------------------- /drawing_generative/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_generative/test.jpg -------------------------------------------------------------------------------- /drawing_strokes/res_23733_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_strokes/res_23733_test.jpg -------------------------------------------------------------------------------- /drawing_strokes/res_52931_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_strokes/res_52931_test.jpg -------------------------------------------------------------------------------- /drawing_strokes/res_72368_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_strokes/res_72368_test.jpg -------------------------------------------------------------------------------- /drawing_strokes/res_84971_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_strokes/res_84971_test.jpg -------------------------------------------------------------------------------- /drawing_strokes/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/drawing_strokes/test.jpg -------------------------------------------------------------------------------- /fm/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fm/test.jpg -------------------------------------------------------------------------------- /fm/test/res_436DBD9F_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fm/test/res_436DBD9F_test.jpg -------------------------------------------------------------------------------- /fm/test/res_AA9DD1D1_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fm/test/res_AA9DD1D1_test.jpg -------------------------------------------------------------------------------- /fm/test/res_AD5D536B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fm/test/res_AD5D536B_test.jpg -------------------------------------------------------------------------------- /fm/test/res_B984EF78_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fm/test/res_B984EF78_test.jpg -------------------------------------------------------------------------------- /fm/test/res_E535BB24_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fm/test/res_E535BB24_test.jpg -------------------------------------------------------------------------------- /fractalify/fractalify.pde: -------------------------------------------------------------------------------- 1 | /* Make fractal from your image 2 | * Sketch draws mandelbrot/julia fractal using channel data to initalize/modify 'z' and 'c' variables. 3 | * a lot of randomness here: channel selection (RGBHSB), colouring, blending, posterizing, fract type (mandel/julia), some factors 4 | */ 5 | 6 | // Author, Tomasz Sulej, generateme.tumblr.com 7 | // email: generateme.blog@gmail.com 8 | // licence: 9 | 10 | /* set image name below 11 | * click mouse button to random change 12 | * press SPACE to save image 13 | */ 14 | 15 | // yes, it's rather slow 16 | 17 | String filename = "test"; 18 | String fileext = ".jpg"; 19 | String foldername = "./"; 20 | 21 | int max_display_size = 800; // viewing window size (regardless image size) 22 | 23 | //////////////////////////////////////// 24 | int type; 25 | int variant; 26 | float fact1; 27 | float fact2; 28 | int chan1,chan2,chan3,chan4,chan5; 29 | int[] order = {0,1,2}; 30 | int[] blendmethods = {ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN}; 31 | boolean doblend, doposterize; 32 | PImage img; 33 | boolean negative; 34 | 35 | // working buffer 36 | PGraphics buffer; 37 | 38 | String sessionid; 39 | 40 | void setup() { 41 | sessionid = hex((int)random(0xffff),4); 42 | img = loadImage(foldername+filename+fileext); 43 | 44 | buffer = createGraphics(img.width, img.height); 45 | buffer.beginDraw(); 46 | buffer.noStroke(); 47 | buffer.smooth(8); 48 | buffer.background(0); 49 | buffer.endDraw(); 50 | 51 | // calculate window size 52 | float ratio = (float)img.width/(float)img.height; 53 | int neww, newh; 54 | if(ratio < 1.0) { 55 | neww = (int)(max_display_size * ratio); 56 | newh = max_display_size; 57 | } else { 58 | neww = max_display_size; 59 | newh = (int)(max_display_size / ratio); 60 | } 61 | 62 | size(neww,newh); 63 | 64 | mouseClicked(); 65 | } 66 | 67 | void draw() {} 68 | 69 | void keyPressed() { 70 | buffer.save(foldername + filename + "/res_" + sessionid + hex((int)random(0xffff),4)+"_"+filename+fileext); 71 | println("image saved"); 72 | } 73 | 74 | void mouseClicked() { 75 | buffer.beginDraw(); 76 | print("drawing... "); 77 | 78 | type=random(1)<0.5?0:1; 79 | variant=random(1)<0.5?0:1; 80 | fact1 = random(0.8,1.3); 81 | fact2 = random(0.8,1.3); 82 | chan1 = (int)random(6); 83 | chan2 = (int)random(6); 84 | chan3 = (int)random(6); 85 | chan4 = (int)random(6); 86 | chan5 = (int)random(6); 87 | doblend = random(1)<0.5; 88 | doposterize = random(1)<0.2; 89 | negative = random(1)<0.5; 90 | randomOrder(); 91 | 92 | float zx,zy,cx,cy; 93 | 94 | for (int y = 0; y < img.height; y++) { 95 | for (int x = 0; x < img.width; x++) { 96 | color c = img.get(x,y); 97 | 98 | if(type == 0) { 99 | zx = fact1*map(sqrt(getChan(chan1,c)*getChan(chan2,c)),0,1,-1,1); 100 | zy = fact1*map(sqrt(getChan(chan3,c)*getChan(chan4,c)),0,1,-1,1); 101 | cx = map(x,0,img.width,-1.4,1.4); 102 | cy = map(y,0,img.height,1.4,1.4); 103 | } else { 104 | cx = fact1*map(sqrt(getChan(chan1,c)*getChan(chan2,c)),0,1,-1,1); 105 | cy = fact1*map(sqrt(getChan(chan3,c)*getChan(chan4,c)),0,1,-1,1); 106 | zx = map(x,0,img.width,-1.4,1.4); 107 | zy = map(y,0,img.height,-1.4,1.4); 108 | } 109 | 110 | if(variant == 0) { 111 | cx *= fact2*sin(getChan(chan5,c)*2*TWO_PI); 112 | cy *= fact2*cos(getChan(chan5,c)*2*TWO_PI); 113 | } else { 114 | zx *= sin(getChan(chan5,c)*2*TWO_PI); 115 | zy *= cos(getChan(chan5,c)*2*TWO_PI); 116 | } 117 | 118 | int iter = 500; 119 | while((sq(zx)+sq(zy))<4.0 && iter-->0) { 120 | float tmp = sq(zx)-sq(zy)+cx; 121 | zy = 2.0 * zx * zy + cy; 122 | zx = tmp; 123 | } 124 | zx = map(zx,0,1.4,0,255); 125 | zy = map(zy,0,1.4,0,255); 126 | 127 | float c1 = order[0]==0?zx%255:order[0]==1?zy%255:51*(iter%6); 128 | float c2 = order[1]==0?zx%255:order[1]==1?zy%255:51*(iter%6); 129 | float c3 = order[2]==0?zx%255:order[2]==1?zy%255:51*(iter%6); 130 | 131 | buffer.fill(c1,c2,c3); 132 | buffer.rect(x,y,1,1); 133 | } 134 | } 135 | 136 | if(doblend) buffer.blend(img, 0,0,img.width,img.height,0,0,img.width,img.height,blendmethods[(int)random(blendmethods.length)]); 137 | if(doposterize) buffer.filter(POSTERIZE,(int)random(3,13)); 138 | 139 | buffer.endDraw(); 140 | image(buffer,0,0,width,height); 141 | 142 | println("done"); 143 | } 144 | 145 | void randomOrder() { 146 | order[0] = (int)random(3); 147 | order[1] = (int)random(3); 148 | order[2] = (int)random(3); 149 | } 150 | 151 | float getChan(int no, color c) { 152 | float t; 153 | switch(no) { 154 | case 0: t = red(c); break; 155 | case 1: t = green(c); break; 156 | case 2: t = blue(c); break; 157 | case 3: t = hue(c); break; 158 | case 4: t = saturation(c); break; 159 | default: t = brightness(c); break; 160 | } 161 | return negative?map(t,0,255,1,0):map(t,0,255,0,1); 162 | } 163 | -------------------------------------------------------------------------------- /fractalify/res_6762_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fractalify/res_6762_test.jpg -------------------------------------------------------------------------------- /fractalify/res_9731_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fractalify/res_9731_test.jpg -------------------------------------------------------------------------------- /fractalify/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/fractalify/test.jpg -------------------------------------------------------------------------------- /granularresynth/audiores.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/granularresynth/audiores.mp3 -------------------------------------------------------------------------------- /granularresynth/granularresynth.pde: -------------------------------------------------------------------------------- 1 | // Granular resynthesis 2 | // Recreate target file using samples from source files 3 | // generateme @ 2017 4 | 5 | // Prepare source files as RAW (audio/images etc. any type) and set filenames 6 | String[] sources = { 7 | "test_img.raw", "test_wav.raw" 8 | }; 9 | // Prepare target file and set filename below 10 | String target_fn = "test_wav.raw"; 11 | // Save to filename 12 | String save_to = "result.raw"; 13 | // Number of grains (10-10000), give low number for SELF to get more glitch 14 | final static int gnum = 10; 15 | // Size of grain in bytes (100-10000) 16 | final static int gsize = 3000; 17 | // How far search for grains (only for SELF) in number of grain sizes 18 | final static int gspread = 25; 19 | // How to gather grains: 20 | // - SELF - use target as a source and take grains from neighborhood 21 | // - ALL - use all files as sources 22 | int type = SELF; 23 | 24 | // do not touch below 25 | 26 | // list of types 27 | final static int SELF = 0; 28 | final static int ALL = 1; 29 | 30 | void setup() { 31 | byte[] target = loadBytes(target_fn); 32 | ArrayList source = new ArrayList(); 33 | 34 | if (type == ALL) { 35 | for (String s : sources) { 36 | source.add( loadBytes(s) ); 37 | } 38 | } 39 | 40 | byte[] result = new byte[target.length]; 41 | 42 | for (int i=0; i 4 | 5 | import java.io.BufferedOutputStream; 6 | import java.io.DataOutputStream; 7 | 8 | // Configuration 9 | int method = COMPRESS; // raw_filename -> lz77_filename 10 | //int method = DECOMPRESS; // lz77_filename -> raw_filename 11 | String raw_filename = "test.raw"; // file name to compress, save as lz77_filename 12 | String lz77_filename = "test.lz77"; // file name to decompress, save as raw_filename 13 | 14 | // compress configuration 15 | int type = LARGE; // SMALL or LARGE, small dictionary and ahead buffer, use the same settings for compressor and decompressor 16 | int compress_factor = 7; // 0 - 8 for LARGE, 0-3 - for SMALL 17 | 18 | // do not touch below 19 | 20 | final static int COMPRESS = 0; 21 | final static int DECOMPRESS = 1; 22 | final static int SMALL = 0; 23 | final static int LARGE = 1; 24 | 25 | void setup() { 26 | size(100,100); 27 | 28 | int dictsize, aheadsize; 29 | if(type == LARGE) { 30 | compress_factor = constrain(compress_factor,0,8); 31 | dictsize = compress_factor+4; 32 | aheadsize = 12-compress_factor; 33 | } else { 34 | compress_factor = constrain(compress_factor,0,3); 35 | dictsize = compress_factor+2; 36 | aheadsize = 6-compress_factor; 37 | } 38 | 39 | int dict = (int)pow(2,dictsize)-1; 40 | int ahead = (int)pow(2,aheadsize)-1; 41 | 42 | LZ77 c = new LZ77(dict,ahead); 43 | 44 | if(method == COMPRESS) { 45 | print("Compressing " + raw_filename + "... "); 46 | byte[] b = loadBytes(raw_filename); 47 | c.doCompress(b); 48 | 49 | try { 50 | DataOutputStream out = new DataOutputStream(new BufferedOutputStream(createOutput(lz77_filename))); 51 | for(Tuple t: c.clist) { 52 | int d = (t.offset & dict) | ( (t.len & ahead) << dictsize ) ; 53 | 54 | out.writeByte( (byte)(d & 0xff) ); 55 | if(type == LARGE) { 56 | out.writeByte( (byte)((d >> 8) & 0xff) ); 57 | } 58 | out.writeByte( t.chr ); 59 | } 60 | out.flush(); 61 | out.close(); 62 | println("done."); 63 | } catch( Exception e) { 64 | e.printStackTrace(); 65 | } 66 | 67 | } else { 68 | print("Decompressing " + lz77_filename + "... "); 69 | byte[] b = loadBytes(lz77_filename); 70 | c.clist.clear(); 71 | 72 | int blen = 0; 73 | for(int iter=0;iter> dictsize) & ahead; 77 | blen += len + 1; 78 | Tuple t = new Tuple(offset,len,b[iter+1+type]); 79 | c.clist.add(t); 80 | } 81 | byte[] buff = new byte[blen]; 82 | c.doDecompress(buff); 83 | 84 | saveBytes("d_"+raw_filename,buff); 85 | 86 | println("done."); 87 | } 88 | 89 | } 90 | 91 | 92 | class Tuple { 93 | public int offset, len; 94 | byte chr; 95 | public Tuple(int o, int l, byte c) { 96 | offset = o; len = l; chr = c; 97 | } 98 | } 99 | 100 | class LZ77 { 101 | int windowWidth; 102 | int lookAheadWidht; 103 | 104 | public LZ77(int ww, int law) { 105 | windowWidth = ww; 106 | lookAheadWidht = law; 107 | } 108 | 109 | public ArrayList clist = new ArrayList(); 110 | 111 | public void glitch(int no, float fac) { 112 | for(int i=0;i=bend;i--) { 136 | if(buff[currByte] == buff[i]) { 137 | 138 | int tboff = abs(i-currByte); 139 | int tblen = 1; 140 | int laEnd = constrain(currByte+lookAheadWidht,0,buff.length-1); 141 | int mi = currByte+1; 142 | 143 | while(miblen) { 153 | blen = tblen; 154 | boff = tboff; 155 | } 156 | 157 | } 158 | } 159 | 160 | currByte +=blen+1; 161 | clist.add( new Tuple(boff,blen,buff[currByte-1]) ); 162 | } 163 | 164 | } 165 | 166 | void doDecompress(byte[] buff) { 167 | int i = 0; 168 | for(Tuple t: clist) { 169 | if(i>=buff.length) break; 170 | if(t.offset == 0) { 171 | buff[i++] = t.chr; 172 | } else { 173 | int start = i-t.offset; 174 | int end = start + t.len; 175 | for(int c = start; c=buff.length) break; 179 | } 180 | if(i>=buff.length) break; 181 | buff[i++] = t.chr; 182 | } 183 | } 184 | } 185 | 186 | } 187 | -------------------------------------------------------------------------------- /lz77_raws/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/lz77_raws/test.jpg -------------------------------------------------------------------------------- /lz77_raws/test.lz77: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/lz77_raws/test.lz77 -------------------------------------------------------------------------------- /lz77_raws/test.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/lz77_raws/test.raw -------------------------------------------------------------------------------- /lz77_raws/test_glitched.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/lz77_raws/test_glitched.jpg -------------------------------------------------------------------------------- /lz77_raws/test_glitched.lz77: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/lz77_raws/test_glitched.lz77 -------------------------------------------------------------------------------- /median_filter/concurrent.pde: -------------------------------------------------------------------------------- 1 | import java.util.concurrent.*; 2 | 3 | ExecutorService executor = Executors.newCachedThreadPool(); 4 | 5 | class CalculatePart implements Callable { 6 | int minx, maxx, miny, maxy, nth; 7 | int[][] source, target; 8 | int[] tmp; 9 | 10 | public CalculatePart(int[][] source, int[][] target, int minx, int maxx, int miny, int maxy, int nth) { 11 | this.minx = minx; 12 | this.maxx = maxx; 13 | this.miny = miny; 14 | this.maxy = maxy; 15 | this.source = source; 16 | this.target = target; 17 | this.nth = nth; 18 | tmp = new int[9]; 19 | } 20 | 21 | void SWAP(int a, int b) { 22 | if (tmp[a]>tmp[b]) { 23 | int t = tmp[a]; 24 | tmp[a]=tmp[b]; 25 | tmp[b]=t; 26 | } 27 | } 28 | 29 | void sort() { 30 | SWAP(0, 1); 31 | SWAP(3, 4); 32 | SWAP(6, 7); 33 | SWAP(1, 2); 34 | SWAP(4, 5); 35 | SWAP(7, 8); 36 | SWAP(0, 1); 37 | SWAP(3, 4); 38 | SWAP(6, 7); 39 | SWAP(0, 3); 40 | SWAP(3, 6); 41 | SWAP(0, 3); 42 | SWAP(1, 4); 43 | SWAP(4, 7); 44 | SWAP(1, 4); 45 | SWAP(2, 5); 46 | SWAP(5, 8); 47 | SWAP(2, 5); 48 | SWAP(1, 3); 49 | SWAP(5, 7); 50 | SWAP(2, 6); 51 | SWAP(4, 6); 52 | SWAP(2, 4); 53 | SWAP(2, 3); 54 | SWAP(5, 6); 55 | } 56 | 57 | public Boolean call() { 58 | for (int x=minx; x[] futures = new Future[cores+1]; 86 | 87 | int i=1; 88 | int iter=0; 89 | while((i+range)<(img.width-1)) { 90 | futures[iter] = executor.submit(new CalculatePart(source, target, i, i+range,1,img.height-1,nth)); 91 | i+=range; 92 | iter++; 93 | } 94 | 95 | if(i= 48 && keyCode <= 56) { 141 | position = keyCode - 48; 142 | println("Position = " + position); 143 | } 144 | } 145 | 146 | // 147 | 148 | final static int[] blends = { 149 | ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN 150 | }; 151 | 152 | // ALL Channels, Nxxx stand for negative (255-value) 153 | // channels to work with 154 | final static int RED = 0; 155 | final static int GREEN = 1; 156 | final static int BLUE = 2; 157 | final static int HUE = 3; 158 | final static int SATURATION = 4; 159 | final static int BRIGHTNESS = 5; 160 | final static int NRED = 6; 161 | final static int NGREEN = 7; 162 | final static int NBLUE = 8; 163 | final static int NHUE = 9; 164 | final static int NSATURATION = 10; 165 | final static int NBRIGHTNESS = 11; 166 | 167 | int getChannel(color c, int channel) { 168 | int ch = channel>5?channel-6:channel; 169 | int cc; 170 | 171 | switch(ch) { 172 | case RED: 173 | cc = ((c>>16) & 0xff); 174 | break; 175 | case GREEN: 176 | cc = ((c>>8) & 0xff); 177 | break; 178 | case BLUE: 179 | cc = (c &0xff); 180 | break; 181 | case HUE: 182 | cc = (int)hue(c); 183 | break; 184 | case SATURATION: 185 | cc = (int)saturation(c); 186 | break; 187 | default: 188 | cc= (int)brightness(c); 189 | break; 190 | } 191 | 192 | return channel>5?255-cc:cc; 193 | } 194 | 195 | void batchStep() throws Exception { 196 | File n = batchList[batchIdx]; 197 | String name = n.getAbsolutePath(); 198 | if (name.endsWith(fileext)) { 199 | print(n.getName()+"... "); 200 | img = loadImage(name); 201 | img.loadPixels(); 202 | reinit(); 203 | batchCallback((float)batchIdx / batchFiles); 204 | processImage(batch_iters); 205 | buffer.save(foldername+batchUID+"/"+n.getName()); 206 | println("saved"); 207 | } 208 | batchIdx++; 209 | if (batchIdx >= batchList.length) { 210 | doBatch = false; 211 | println("results saved in "+ foldername+batchUID + " folder"); 212 | } 213 | } 214 | 215 | File[] batchList; 216 | int batchIdx = 0; 217 | String batchUID; 218 | boolean doBatch = false; 219 | float batchFiles = 0; 220 | void batchProcess() { 221 | batchUID = sessionid + hex((int)random(0xffff), 4); 222 | File dir = new File(sketchPath+'/'+foldername); 223 | batchList = dir.listFiles(); 224 | batchIdx = 0; 225 | batchFiles = 0; 226 | for (File n : batchList) { 227 | if (n.getName().endsWith(fileext)) batchFiles=batchFiles+1.0; 228 | } 229 | println("Processing "+int(batchFiles)+" images from folder: " + foldername); 230 | doBatch = true; 231 | } 232 | 233 | -------------------------------------------------------------------------------- /median_filter/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/median_filter/test.jpg -------------------------------------------------------------------------------- /median_filter/test/res_BE92D61D_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/median_filter/test/res_BE92D61D_test.jpg -------------------------------------------------------------------------------- /mirrorimage/res_34901_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/mirrorimage/res_34901_test.jpg -------------------------------------------------------------------------------- /mirrorimage/res_36847_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/mirrorimage/res_36847_test.jpg -------------------------------------------------------------------------------- /mirrorimage/res_75749_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/mirrorimage/res_75749_test.jpg -------------------------------------------------------------------------------- /mirrorimage/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/mirrorimage/test.jpg -------------------------------------------------------------------------------- /moire/moire.pde: -------------------------------------------------------------------------------- 1 | // Moire pattern generator 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | // * click to random change 8 | // * press 'a' to animate (and save frames) 9 | 10 | // set up filename 11 | String filename = "moire"; 12 | String fileext = ".jpg"; 13 | String foldername = "./"; 14 | 15 | int image_size = 600; // setup result size 16 | int max_display_size = 600; // viewing window size (regardless result size) 17 | 18 | float stripe_density = 15; // higher number, narrower stripes 19 | 20 | float rx = 2; // operating range for x from -rx to rx, from 0.5 to 5 21 | float ry = 2; // operating range for x from -ry to ry, from 0.5 to 5 22 | 23 | boolean animate = false; 24 | int frames = 24; 25 | 26 | // working buffer 27 | PGraphics buffer; 28 | 29 | String sessionid; 30 | 31 | void setup() { 32 | sessionid = hex((int)random(0xffff), 4); 33 | buffer = createGraphics(image_size, image_size); 34 | buffer.beginDraw(); 35 | buffer.noStroke(); 36 | buffer.smooth(8); 37 | buffer.background(0); 38 | buffer.endDraw(); 39 | 40 | size(max_display_size, max_display_size); 41 | 42 | reinit(); 43 | processImage(); 44 | } 45 | 46 | float phase = 0; 47 | int current_step = 0; 48 | String animationKey; 49 | 50 | void draw() { 51 | if(animate) { 52 | println("frame "+(current_step+1)+"/"+frames); 53 | 54 | processImage(); 55 | 56 | String fn = foldername + filename + "/frames"+animationKey+"/res_" + animationKey +"_"+(1000+current_step)+"_"+filename+fileext; 57 | buffer.save(fn); 58 | 59 | phase=current_step*TWO_PI/frames; 60 | 61 | current_step++; 62 | if(current_step>=frames) { 63 | animate = false; 64 | println("saving frames done"); 65 | } 66 | } 67 | } 68 | 69 | final static int[] non_random_folds = { 70 | 175, 173, 170, 171, 167, 168, 169, 165, 160, 161, 162, 163, 159, 153, 154, 155, 156, 157, 152, 150, 148, 149, 147, 144, 143, 136, 137, 138, 135, 134, 130, 131, 126, 127, 128, 129, 125, 123, 121, 118, 119, 116, 115, 111, 106, 107, 108, 109, 102, 103, 104, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 61, 62, 63, 64, 65, 66, 67, 68, 69, 60, 59, 56, 55, 54, 52, 49, 47, 46, 44, 43, 31, 32, 33, 34, 29, 30, 28, 25, 26, 27, 24, 23, 22, 21, 19, 18, 17, 16, 15, 14, 12, 13, 11, 9, 8, 7, 6, 3, 4, 5 71 | }; 72 | 73 | Folds f; 74 | int[] folds; 75 | boolean stype; 76 | int foldnumber; 77 | 78 | void reinit() { 79 | f = new Folds(width, -rx, rx, -ry, ry); 80 | 81 | foldnumber = (int)floor(random(3))+1; 82 | folds = new int[foldnumber]; 83 | for (int i=0;i"; 91 | } 92 | println(""); 93 | println(s + "p"); 94 | if (stype) println("linear"); 95 | else println("circular"); 96 | 97 | } 98 | 99 | void processImage() { 100 | buffer.beginDraw(); 101 | 102 | for (int x=0;x// 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // This sketch traverses line by line and draws a vline when choosen channel changes value beyond set tolerance 6 | // First point in line selects line color. Lines are snapped left into the random grid made from noise function 7 | 8 | // Usage: 9 | // * press SPACE to save 10 | // * click for random change 11 | // * press 'g' to toggle grid size change during randomization 12 | 13 | // set up filename 14 | String filename = "test"; 15 | String fileext = ".jpg"; 16 | String foldername = "./"; 17 | 18 | int max_display_size = 800; // viewing window size (regardless image size) 19 | 20 | // configuration 21 | // average noise grid size, examples of generated grids are in grid_examples folder 22 | int nx = 30; // 1 - width 23 | int ny = 20; // 1 - height 24 | 25 | // tolerance of channel value change, this is kind of edge detection sensivity 26 | int tolerance = 50; // 1 (every channel value change starts new line) - 255 (one color line) 27 | // channel to test 28 | int channel = BRIGHTNESS; 29 | 30 | // fill the gaps between grids, if false fill them with background_color 31 | boolean whole = true; // true or false 32 | // color to fill grid gaps 33 | color background_color = color(188, 188, 188); 34 | 35 | // skip grid size change during random, press G to change it 36 | boolean skip_grid = true; 37 | 38 | boolean do_blend = false; // blend image after process 39 | int blend_mode = OVERLAY; // blend type 40 | 41 | // working buffer 42 | PGraphics buffer; 43 | 44 | // image 45 | PImage img; 46 | 47 | String sessionid; 48 | 49 | void setup() { 50 | sessionid = hex((int)random(0xffff), 4); 51 | img = loadImage(foldername+filename+fileext); 52 | 53 | buffer = createGraphics(img.width, img.height); 54 | buffer.beginDraw(); 55 | buffer.noStroke(); 56 | buffer.noFill(); 57 | buffer.background(0); 58 | buffer.endDraw(); 59 | 60 | // calculate window size 61 | float ratio = (float)img.width/(float)img.height; 62 | int neww, newh; 63 | if (ratio < 1.0) { 64 | neww = (int)(max_display_size * ratio); 65 | newh = max_display_size; 66 | } 67 | else { 68 | neww = max_display_size; 69 | newh = (int)(max_display_size / ratio); 70 | } 71 | 72 | size(neww, newh); 73 | grid = new int[img.width][img.height]; 74 | 75 | processImage(); 76 | } 77 | 78 | void mouseClicked() { 79 | // randomize 80 | if(!skip_grid) { 81 | nx = (int)random(1,img.width/5); 82 | ny = (int)random(1,img.height/5); 83 | } 84 | tolerance = random(1)<0.8 ? (int)random(5,80) : (int)random(5,250); 85 | whole = random(1)<0.5; 86 | channel = (int)random(6); 87 | 88 | do_blend = random(1)<0.1; 89 | blend_mode = blends[ (int)random(blends.length) ]; 90 | 91 | background_color = img.get( (int)map(mouseX,0,width-1,0,img.width-1), (int)map(mouseY,0,height-1,0,img.height-1) ); 92 | 93 | println(""); 94 | println("nx="+nx); 95 | println("ny="+ny); 96 | println("tolerance="+tolerance); 97 | println("whole="+whole); 98 | println("channel="+channel); 99 | println("do_blend="+do_blend); 100 | println("blend_mode="+blend_mode); 101 | println("background_color=#" + hex(0xffffff & background_color,6)); 102 | 103 | processImage(); 104 | } 105 | 106 | void draw() { 107 | // fill for iterative processing 108 | } 109 | 110 | int[][] grid; 111 | 112 | void processImage() { 113 | print("Processing..."); 114 | buffer.beginDraw(); 115 | buffer.background(background_color); 116 | // START CODE HERE! use buffer to draw/manipulate 117 | 118 | noiseSeed( (long)random(MAX_INT) ); 119 | 120 | float scale = random(2); 121 | int nnx = int(scale*nx)+1; 122 | int nny = int(scale*ny)+1; 123 | 124 | for (int y=0; y= tolerance) { 165 | buffer.stroke( currentc ); 166 | int myx = (whole && lastx < grid[x][y]) ? lastx : grid[x][y]; 167 | buffer.line( myx, y, x, y ); 168 | currentc = c; 169 | currentb = b; 170 | lastx = x; 171 | } 172 | } 173 | x--; 174 | buffer.stroke( currentc ); 175 | int myx = lastx < grid[x][y] ? lastx : grid[x][y]; 176 | buffer.line( myx, y, x, y ); 177 | } 178 | } 179 | 180 | void keyPressed() { 181 | // SPACE to save 182 | if (keyCode == 32) { 183 | String fn = foldername + filename + "/res_" + sessionid + hex((int)random(0xffff), 4)+"_"+filename+fileext; 184 | buffer.save(fn); 185 | println("Image "+ fn + " saved"); 186 | } else if(key == 'g') { 187 | skip_grid = !skip_grid; 188 | println("skip grid size change = " + (skip_grid ? "true" : "false") ); 189 | } 190 | } 191 | 192 | // 193 | 194 | final static int[] blends = { 195 | ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN 196 | }; 197 | 198 | // ALL Channels, Nxxx stand for negative (255-value) 199 | // channels to work with 200 | final static int RED = 0; 201 | final static int GREEN = 1; 202 | final static int BLUE = 2; 203 | final static int HUE = 3; 204 | final static int SATURATION = 4; 205 | final static int BRIGHTNESS = 5; 206 | final static int NRED = 6; 207 | final static int NGREEN = 7; 208 | final static int NBLUE = 8; 209 | final static int NHUE = 9; 210 | final static int NSATURATION = 10; 211 | final static int NBRIGHTNESS = 11; 212 | 213 | float getChannel(color c, int channel) { 214 | int ch = channel>5?channel-6:channel; 215 | float cc; 216 | 217 | switch(ch) { 218 | case RED: 219 | cc = red(c); 220 | break; 221 | case GREEN: 222 | cc = green(c); 223 | break; 224 | case BLUE: 225 | cc = blue(c); 226 | break; 227 | case HUE: 228 | cc = hue(c); 229 | break; 230 | case SATURATION: 231 | cc = saturation(c); 232 | break; 233 | default: 234 | cc= brightness(c); 235 | break; 236 | } 237 | 238 | return channel>5?255-cc:cc; 239 | } 240 | -------------------------------------------------------------------------------- /pix2line/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pix2line/test.jpg -------------------------------------------------------------------------------- /pix2line/test/res_336057F4_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pix2line/test/res_336057F4_test.jpg -------------------------------------------------------------------------------- /pix2line/test/res_6CA63EA7_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pix2line/test/res_6CA63EA7_test.jpg -------------------------------------------------------------------------------- /pix2line/test/res_84DC18E0_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pix2line/test/res_84DC18E0_test.jpg -------------------------------------------------------------------------------- /pix2line/test/res_E8CF0AB7_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pix2line/test/res_E8CF0AB7_test.jpg -------------------------------------------------------------------------------- /pixeldrifter/pixeldrifter.pde: -------------------------------------------------------------------------------- 1 | // Drift pixels and blend, repeat 2 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 3 | // Licence: http://unlicense.org/ 4 | 5 | // Usage: 6 | // * press SPACE to save 7 | 8 | // set up filename 9 | String filename = "test"; 10 | String fileext = ".jpg"; 11 | String foldername = "./"; 12 | 13 | int max_display_size = 800; // viewing window size (regardless image size) 14 | 15 | // config 16 | int channel = HUE; // channel data used for shift 17 | float channel_off = 60; // channel value offset 18 | int iteration_no = 50; // number of iterations 10-100 19 | int direction = UP; // UP, DOWN, LEFT, RIGHT 20 | boolean image_mix = false; // mix with original image or current buffer 21 | boolean automate_channel_offset = false; // if true, change channel_offset every iteration 22 | float scale = 0.03; // 0.01 - 0.1, step size (0.01: 2px, 0.1:25px) 23 | float feedback = 0.9; // 0.9 - 0.999 ; blend ratio with original image 24 | 25 | boolean do_blend = false; // blend image after process 26 | int blend_mode = OVERLAY; // blend type 27 | 28 | // working buffer 29 | PGraphics buffer; 30 | 31 | // image 32 | PImage img, imgb; 33 | 34 | String sessionid; 35 | float acho_step; 36 | 37 | void setup() { 38 | sessionid = hex((int)random(0xffff),4); 39 | img = loadImage(foldername+filename+fileext); 40 | imgb = img.get(); 41 | 42 | buffer = createGraphics(img.width, img.height); 43 | buffer.beginDraw(); 44 | buffer.noStroke(); 45 | buffer.smooth(8); 46 | buffer.background(0); 47 | buffer.image(img,0,0); 48 | buffer.endDraw(); 49 | 50 | // calculate window size 51 | float ratio = (float)img.width/(float)img.height; 52 | int neww, newh; 53 | if(ratio < 1.0) { 54 | neww = (int)(max_display_size * ratio); 55 | newh = max_display_size; 56 | } else { 57 | neww = max_display_size; 58 | newh = (int)(max_display_size / ratio); 59 | } 60 | 61 | size(neww,newh); 62 | 63 | scale = abs(scale); 64 | acho_step = 256.0 / iteration_no; 65 | println(acho_step); 66 | } 67 | 68 | void draw() { 69 | if(iteration_no>0) { 70 | processImage(); 71 | iteration_no--; 72 | println("steps left: "+iteration_no); 73 | } else { 74 | if(do_blend) { 75 | buffer.beginDraw(); 76 | buffer.blend(img,0,0,img.width,img.height,0,0,buffer.width,buffer.height,blend_mode); 77 | buffer.endDraw(); 78 | } 79 | image(buffer,0,0,width,height); 80 | noLoop(); 81 | } 82 | } 83 | 84 | void processImage() { 85 | buffer.beginDraw(); 86 | 87 | for(int x=0;x5?channel-6:channel; 136 | float cc; 137 | 138 | switch(ch) { 139 | case RED: cc = red(c); break; 140 | case GREEN: cc = green(c); break; 141 | case BLUE: cc = blue(c); break; 142 | case HUE: cc = hue(c); break; 143 | case SATURATION: cc = saturation(c); break; 144 | default: cc= brightness(c); break; 145 | } 146 | 147 | return channel>5?255-cc:cc; 148 | } 149 | -------------------------------------------------------------------------------- /pixeldrifter/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pixeldrifter/test.jpg -------------------------------------------------------------------------------- /pixeldrifter/test/res_3DFBDFBD_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pixeldrifter/test/res_3DFBDFBD_test.jpg -------------------------------------------------------------------------------- /pixeldrifter/test/res_6E03D9C8_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pixeldrifter/test/res_6E03D9C8_test.jpg -------------------------------------------------------------------------------- /pixeldrifter/test/res_C46F2C23_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pixeldrifter/test/res_C46F2C23_test.jpg -------------------------------------------------------------------------------- /pixeldrifter/test/res_FF2FD95F_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pixeldrifter/test/res_FF2FD95F_test.jpg -------------------------------------------------------------------------------- /pngglitch/code/pngj.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/pngglitch/code/pngj.jar -------------------------------------------------------------------------------- /pngglitch/pngglitch.pde: -------------------------------------------------------------------------------- 1 | // PNG glitch tool 2 | // Based on hacked pngj and zlib libraries 3 | // https://github.com/leonbloy/pngj 4 | // http://jazzlib.sourceforge.net 5 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 6 | // Licence: http://unlicense.org/ 7 | 8 | // Description: Prepare PNG image, it has to be PNG 24bit. 9 | // Note: Choose different compression level to get different artifacts! 10 | // eg. ImageMagick compression level from 1 to 5 selects different filters: 11 | // 1 - Sub, 2 - Up, 3 - Average, 4 - Paeth, 5 - None 12 | // 0,6-9 are combination of above (based probably on some heuristics) 13 | // Note 2: other convert programs can give different results! 14 | 15 | // Usage: 16 | // * press SPACE to save 17 | // * press 0 to turn on/off filter decode 18 | // * press 1-5 to choose filter used 19 | // * click to glitch around pointed place 20 | // * press q,w,e,r,t to choose glitch method 21 | // * press u for remove (undo) last glitch point 22 | // * press a for add random glitches for lines 23 | // * prezz z for reset all glitches (but not filter) 24 | 25 | // One more reminder: prepare your PNG first, choose PNG24 and compression level (from 0 to 9) 26 | 27 | import ar.com.hjg.pngj.*; 28 | import tsl.corruptinfo.Corruptor; 29 | import java.io.InputStream; 30 | 31 | // set up filename 32 | String filename = "test"; 33 | String fileext = ".png"; 34 | String foldername = "./"; 35 | 36 | int max_display_size = 1000; // viewing window size (regardless image size) 37 | 38 | // select global filtering 39 | boolean do_filtering = false; 40 | int filter = 0; // 0-4, 0 - NONE, 1 - SUB, 2 - UP, 3 - AVERAGE, 4 - PAETH 41 | // choose method for glitch by click (to be honest, do not see any difference) 42 | int glitch_method = Corruptor.RANDOM; // Corruptor.SUB1, Corruptor.ZERO, Corruptor.NEGATE, Corruptor.RANDOM, Corruptor.ADD1 43 | int lines_glitched = 10; // this is average number of glitched lines after 'a' pressed 44 | 45 | // working buffer 46 | PGraphics buffer; 47 | 48 | String sessionid; 49 | 50 | PngReader pngr; 51 | 52 | void setup() { 53 | sessionid = hex((int)random(0xffff),4); 54 | 55 | Corruptor.force_filter = do_filtering; 56 | Corruptor.filtermethod = filter; 57 | 58 | readPNG(); 59 | buffer = createGraphics(pngr.imgInfo.cols, pngr.imgInfo.rows); 60 | buffer.beginDraw(); 61 | buffer.noStroke(); 62 | buffer.smooth(8); 63 | buffer.background(0); 64 | buffer.endDraw(); 65 | 66 | // calculate window size 67 | float ratio = (float)buffer.width/(float)buffer.height; 68 | int neww, newh; 69 | if(ratio < 1.0) { 70 | neww = (int)(max_display_size * ratio); 71 | newh = max_display_size; 72 | } else { 73 | neww = max_display_size; 74 | newh = (int)(max_display_size / ratio); 75 | } 76 | 77 | size(neww,newh); 78 | 79 | processImage(); 80 | } 81 | 82 | void draw() { 83 | // fill for iterative processing 84 | } 85 | 86 | void readPNG() { 87 | InputStream is = createInput(foldername+filename+fileext); 88 | pngr = new PngReader(is); 89 | } 90 | 91 | void redo() { 92 | print("Reading image..."); 93 | readPNG(); 94 | processImage(); 95 | println("done"); 96 | } 97 | 98 | void processImage() { 99 | buffer.beginDraw(); 100 | 101 | try { 102 | IImageLineSet lines = pngr.readRows(); 103 | for(int i=0;i= 49 && keyCode <=53) { 165 | if(Corruptor.force_filter) { 166 | Corruptor.filtermethod = keyCode - 49; 167 | println("Filter method set to " + getFilterMethodName(Corruptor.filtermethod)); 168 | redo(); 169 | } else { 170 | println("Turn on filtering (press 0)"); 171 | } 172 | } 173 | if(key == 'q') { glitch_method = 0; println("Glitch method set to: " + getGlitchMethodName(0)); } 174 | if(key == 'w') { glitch_method = 1; println("Glitch method set to: " + getGlitchMethodName(1)); } 175 | if(key == 'e') { glitch_method = 2; println("Glitch method set to: " + getGlitchMethodName(2)); } 176 | if(key == 'r') { glitch_method = 3; println("Glitch method set to: " + getGlitchMethodName(3)); } 177 | if(key == 't') { glitch_method = 4; println("Glitch method set to: " + getGlitchMethodName(4)); } 178 | if(keyCode == 48) { 179 | Corruptor.force_filter = !Corruptor.force_filter; 180 | println("Force filter: " + Corruptor.force_filter); 181 | redo(); 182 | } 183 | if(key == 'a') { 184 | println("Random glitches"); 185 | float prob = lines_glitched/(float)buffer.height; 186 | for(int l=0;l0 && in.available()>skip_header) { 52 | byte[] b = new byte[skip_header]; 53 | in.read(b); 54 | out.write(b); 55 | } 56 | int cnt = 0; 57 | while( (cnt=(in.available()-skip_footer))>0) { 58 | int l = max_chunk_size; 59 | if(cnt0) { 66 | byte[] b = new byte[skip_footer]; 67 | in.read(b); 68 | out.write(b); 69 | } 70 | out.flush(); 71 | out.close(); 72 | in.close(); 73 | 74 | } catch(Exception e) { 75 | e.printStackTrace(); 76 | } 77 | println("done"); 78 | exit(); 79 | } 80 | } 81 | 82 | void processImage(PImage img) { 83 | img.loadPixels(); 84 | color[] buf = new color[img.pixels.length-skip_header-skip_footer]; 85 | arrayCopy(img.pixels,skip_header,buf,0,img.pixels.length-skip_header-skip_footer); 86 | arrayCopy(bytes2pixels(processRules(pixels2bytes(buf),0)),0,img.pixels,skip_header,buf.length); 87 | img.updatePixels(); 88 | img.save("res_"+filename); 89 | } 90 | 91 | byte[] pixels2bytes(color[] px) { 92 | byte[] result = new byte[4*px.length]; 93 | for(int i=0,j=0;i>> 24); 95 | result[i+2] = (byte)((px[j] << 16) >>> 24); 96 | result[i+1] = (byte)((px[j] << 8) >>> 24); 97 | result[i] = (byte)(px[j] >>> 24); 98 | } 99 | return result; 100 | } 101 | 102 | color[] bytes2pixels(byte[] px) { 103 | color[] result = new color[px.length/4]; 104 | for(int i=0,j=0;i= rules.length) return pix; 113 | 114 | ArrayList chunks = new ArrayList(); 115 | Rule rule = rules[depth]; 116 | if(rule.method == DIVIDE_G || rule.method == SHUFFLE_G) { 117 | int idx = 0; 118 | while(idx=pix.length) 121 | l = pix.length-idx; 122 | 123 | Chunk chunk = new Chunk(); 124 | chunk.ch = new byte[l]; 125 | arrayCopy(pix,idx,chunk.ch,0,l); 126 | 127 | chunks.add(chunk); 128 | 129 | idx+=l; 130 | } 131 | } 132 | if(rule.method == SHUFFLE_G) Collections.shuffle(chunks); 133 | if(rule.method == SHUFFLE || rule.method == PERMUTATE) { 134 | int idx = 0; 135 | int pidx = 0; 136 | ArrayList pchunks = new ArrayList(rule.p1.length); 137 | while(idx=pix.length) 140 | l = pix.length-idx; 141 | 142 | Chunk chunk = new Chunk(); 143 | chunk.ch = new byte[l]; 144 | arrayCopy(pix,idx,chunk.ch,0,l); 145 | 146 | pchunks.add(chunk); 147 | pidx++; 148 | 149 | if(pidx == rule.p1.length) { 150 | if(rule.method == SHUFFLE) { 151 | Collections.shuffle(pchunks); 152 | chunks.addAll(pchunks); 153 | } 154 | if(rule.method == PERMUTATE) { 155 | for(int i : rule.p2) { 156 | chunks.add(pchunks.get(i)); 157 | } 158 | } 159 | pchunks.clear(); 160 | pidx = 0; 161 | } 162 | 163 | idx+=l; 164 | } 165 | } 166 | 167 | for(Chunk chunk : chunks) { 168 | chunk.ch = processRules(chunk.ch,depth+1); 169 | } 170 | 171 | int idx=0; 172 | for(Chunk chunk : chunks) { 173 | arrayCopy(chunk.ch,0,result,idx,chunk.ch.length); 174 | idx+=chunk.ch.length; 175 | } 176 | 177 | 178 | return result; 179 | } 180 | 181 | class Chunk { 182 | byte[] ch; 183 | } 184 | 185 | final static int SHUFFLE = 0; // shuffle with pattern 186 | final static int SHUFFLE_G = 1; // shuffle globally 187 | final static int PERMUTATE = 2; // permutate pattern 188 | final static int DIVIDE_G = 3; // divide globally 189 | 190 | class Rule { 191 | int[] p1,p2; 192 | int method; 193 | int len; 194 | 195 | public Rule(int method, int[] p) { 196 | this(method,p,p); 197 | } 198 | 199 | public Rule(int method, int w) { 200 | this.method = method; 201 | this.len = w; 202 | } 203 | 204 | public Rule(int method, int[] p1, int[] p2) { 205 | this.method = method; 206 | this.p1 = p1; 207 | this.p2 = p2; 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /shufflestream/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/shufflestream/test.jpg -------------------------------------------------------------------------------- /slitscan/res_18923_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/slitscan/res_18923_test.jpg -------------------------------------------------------------------------------- /slitscan/res_19233_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/slitscan/res_19233_test.jpg -------------------------------------------------------------------------------- /slitscan/res_59570_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/slitscan/res_59570_test.jpg -------------------------------------------------------------------------------- /slitscan/res_62271_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/slitscan/res_62271_test.jpg -------------------------------------------------------------------------------- /slitscan/slitscan.pde: -------------------------------------------------------------------------------- 1 | // Distort the image 2 | // generateme.blog@gmail.com 3 | // Tomasz Sulej // generateme.tumblr.com 4 | // 5 | // Licence: 6 | 7 | // - click to change 8 | // - keypress to save result 9 | 10 | // sometimes it copies the image, I don't know why, ignore and click more 11 | 12 | // put file name here 13 | String filename = "test"; 14 | String fileext = ".jpg"; 15 | String foldername = "./"; 16 | 17 | int max_display_size = 800; // viewing window size (regardless image size) 18 | 19 | // logic starts here 20 | int[] fx; 21 | int[] fy; 22 | 23 | float[] phx; 24 | float[] phy; 25 | 26 | int[] sx,sy; 27 | 28 | boolean[] skipfx; 29 | boolean[] skipfy; 30 | 31 | boolean dox,doy; 32 | 33 | PImage img; 34 | 35 | float[][] ft = new float[2][32]; 36 | 37 | int depth; // number of octaves 38 | 39 | // working buffer 40 | PGraphics buffer; 41 | 42 | String sessionid; 43 | 44 | void setup() { 45 | sessionid = hex((int)random(0xffff),4); 46 | img = loadImage(foldername+filename+fileext); 47 | 48 | buffer = createGraphics(img.width, img.height); 49 | buffer.beginDraw(); 50 | buffer.noStroke(); 51 | buffer.fill(255); 52 | buffer.background(0); 53 | buffer.endDraw(); 54 | 55 | // calculate window size 56 | float ratio = (float)img.width/(float)img.height; 57 | int neww, newh; 58 | if(ratio < 1.0) { 59 | neww = (int)(max_display_size * ratio); 60 | newh = max_display_size; 61 | } else { 62 | neww = max_display_size; 63 | newh = (int)(max_display_size / ratio); 64 | } 65 | 66 | size(neww,newh); 67 | 68 | for(int i=0;i<32;i++) { 69 | ft[0][i] = pow(2.0,i); 70 | ft[1][i] = 0.5*1.0/ft[0][i]; 71 | } 72 | 73 | int s = img.width>img.height?img.height:img.width; 74 | depth = (int)(log(s)/log(2)); 75 | 76 | mouseClicked(); 77 | } 78 | 79 | void mouseClicked() { 80 | buffer.beginDraw(); 81 | int fxnum = (int)random(depth); 82 | int fynum = (int)random(depth); 83 | 84 | fx = new int[fxnum+1]; 85 | fy = new int[fynum+1]; 86 | sx = new int[fxnum+1]; 87 | sy = new int[fynum+1]; 88 | 89 | phx = new float[fxnum+1]; 90 | phy = new float[fynum+1]; 91 | 92 | skipfx = new boolean[fxnum+1]; 93 | skipfy = new boolean[fynum+1]; 94 | 95 | for(int i=0;i5?channel-6:channel; 201 | float cc; 202 | 203 | switch(ch) { 204 | case RED: cc = red(c); break; 205 | case GREEN: cc = green(c); break; 206 | case BLUE: cc = blue(c); break; 207 | case HUE: cc = hue(c); break; 208 | case SATURATION: cc = saturation(c); break; 209 | default: cc= brightness(c); break; 210 | } 211 | 212 | return channel>5?255-cc:cc; 213 | } 214 | -------------------------------------------------------------------------------- /ultimateSort/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/ultimateSort/test.jpg -------------------------------------------------------------------------------- /ultimateSort/test/res_43D4F76F_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/ultimateSort/test/res_43D4F76F_test.jpg -------------------------------------------------------------------------------- /ultimateSort/test/res_D16C8172_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/ultimateSort/test/res_D16C8172_test.jpg -------------------------------------------------------------------------------- /watmap/bl/bl1000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/bl/bl1000.jpg -------------------------------------------------------------------------------- /watmap/bl/bl1001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/bl/bl1001.jpg -------------------------------------------------------------------------------- /watmap/bl/bl1002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/bl/bl1002.jpg -------------------------------------------------------------------------------- /watmap/bl/bl1003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/bl/bl1003.jpg -------------------------------------------------------------------------------- /watmap/bl/bl1004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/bl/bl1004.jpg -------------------------------------------------------------------------------- /watmap/bl/bl1005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/bl/bl1005.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0003.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0004.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0005.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0006.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0007.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0008.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0009.jpg -------------------------------------------------------------------------------- /watmap/nyt/NYTimes-Dec1900-Jan1901_0010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/nyt/NYTimes-Dec1900-Jan1901_0010.jpg -------------------------------------------------------------------------------- /watmap/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/test.jpg -------------------------------------------------------------------------------- /watmap/test/res_00CB832B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/test/res_00CB832B_test.jpg -------------------------------------------------------------------------------- /watmap/test/res_7CAE6A7A_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/watmap/test/res_7CAE6A7A_test.jpg -------------------------------------------------------------------------------- /wavelets/code/JWave.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wavelets/code/JWave.jar -------------------------------------------------------------------------------- /wavelets/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wavelets/test.jpg -------------------------------------------------------------------------------- /wavelets/test/res_A29820C2_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wavelets/test/res_A29820C2_test.jpg -------------------------------------------------------------------------------- /wavelets/test/res_A298612B_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wavelets/test/res_A298612B_test.jpg -------------------------------------------------------------------------------- /wavelets/test/res_A2986DB5_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wavelets/test/res_A2986DB5_test.jpg -------------------------------------------------------------------------------- /wavelets/test/res_A2989237_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wavelets/test/res_A2989237_test.jpg -------------------------------------------------------------------------------- /wrongqsort/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wrongqsort/test.jpg -------------------------------------------------------------------------------- /wrongqsort/test/res_7B682694_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wrongqsort/test/res_7B682694_test.jpg -------------------------------------------------------------------------------- /wrongqsort/test/res_7B684217_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wrongqsort/test/res_7B684217_test.jpg -------------------------------------------------------------------------------- /wrongqsort/test/res_7B6873D4_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wrongqsort/test/res_7B6873D4_test.jpg -------------------------------------------------------------------------------- /wrongqsort/wrongqsort.pde: -------------------------------------------------------------------------------- 1 | // Wrong QuickSort algorithm 2 | // Based on following code by Mick Kellogg, http://www.openprocessing.org/sketch/53609 3 | // Tomasz Sulej, generateme.blog@gmail.com, http://generateme.tumblr.com 4 | // Licence: CC-BY-SA 5 | 6 | // Usage: 7 | // * press SPACE to save 8 | // * click to change mode 9 | // * move mouse to choose line size to sort (length equals x*y) 10 | // - top-left region - short lines 11 | // - middle - long, bigger parts of image 12 | 13 | // set up filename 14 | String filename = "test"; 15 | String fileext = ".jpg"; 16 | String foldername = "./"; 17 | 18 | int max_display_size = 800; // viewing window size (regardless image size) 19 | 20 | boolean mode = L; // L or R, which sort part is broken 21 | 22 | boolean do_blend = false; // blend image after process 23 | int blend_mode = OVERLAY; // blend type 24 | 25 | static final boolean L = true; 26 | static final boolean R = false; 27 | 28 | // working buffer 29 | PGraphics buffer; 30 | 31 | // image 32 | PImage img; 33 | 34 | String sessionid; 35 | 36 | void setup() { 37 | sessionid = hex((int)random(0xffff),4); 38 | img = loadImage(foldername+filename+fileext); 39 | 40 | buffer = createGraphics(img.width, img.height); 41 | buffer.beginDraw(); 42 | buffer.noStroke(); 43 | buffer.smooth(8); 44 | buffer.background(0); 45 | buffer.image(img,0,0); 46 | buffer.endDraw(); 47 | 48 | // calculate window size 49 | float ratio = (float)img.width/(float)img.height; 50 | int neww, newh; 51 | if(ratio < 1.0) { 52 | neww = (int)(max_display_size * ratio); 53 | newh = max_display_size; 54 | } else { 55 | neww = max_display_size; 56 | newh = (int)(max_display_size / ratio); 57 | } 58 | 59 | size(neww,newh); 60 | 61 | len = img.width * img.height; 62 | processImage((int)random(len-1)+1); 63 | } 64 | 65 | int len; 66 | 67 | void draw() { 68 | float x = map(mouseX, 0, width-1,0,1); 69 | float y = map(mouseY, 0, height-1,0,1); 70 | int vall = (int)map(x*y,0,1,1,len-1); 71 | processImage(vall); 72 | } 73 | 74 | float random_point = 0.5; 75 | void mouseMoved() { 76 | random_point = random(0.1,0.9); 77 | } 78 | 79 | void processImage(int v) { 80 | buffer.beginDraw(); 81 | buffer.image(img,0,0); 82 | buffer.endDraw(); 83 | 84 | buffer.loadPixels(); 85 | 86 | int x = 0; 87 | while(x pivot) { 130 | j--; 131 | } 132 | if (i <= j) { 133 | temp = x[i]; 134 | x[i] = x [j]; 135 | x[j] = temp; 136 | i++; 137 | j--; 138 | } 139 | } 140 | return i; 141 | } 142 | 143 | void quicksort(int x[], int left, int right) { 144 | if(left index-1) quicksort(x, left, index-1); 151 | if(right > index) quicksort(x, index, right); 152 | } 153 | } 154 | } 155 | 156 | final static int[] blends = {ADD, SUBTRACT, DARKEST, LIGHTEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN}; 157 | -------------------------------------------------------------------------------- /wzipprocess2/res_0018_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wzipprocess2/res_0018_test.jpg -------------------------------------------------------------------------------- /wzipprocess2/res_0022_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wzipprocess2/res_0022_test.jpg -------------------------------------------------------------------------------- /wzipprocess2/res_0034_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wzipprocess2/res_0034_test.jpg -------------------------------------------------------------------------------- /wzipprocess2/res_0062_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wzipprocess2/res_0062_test.jpg -------------------------------------------------------------------------------- /wzipprocess2/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsulej/GenerateMe/3060a846fc66b6c230f6a88dda8cb78d0f75027e/wzipprocess2/test.jpg -------------------------------------------------------------------------------- /wzipprocess2/wzipprocess2.pde: -------------------------------------------------------------------------------- 1 | // wzip - a preprocessor for lossy data compression, originally: Copyright (C) 1997 Andreas Franzen 2 | // Processing port, Tomasz Sulej, generateme.blog@gmail.com 3 | // Haar wavelet transformation to glitch your raw images, operates on bytes, use different scaling factors (see below) 4 | 5 | // Licence GNU GPL 2.0 6 | 7 | // move mouse around the image 8 | // * press ENTER/RETURN to change scale for scaling factors 9 | // * press SPACE to toggle between RGBRGB... (HSBHSB...) or RRR...GGG...BBB... (HHH...SSS...BBB...) raws 10 | // * click to save 11 | 12 | // filename 13 | String filename = "test"; 14 | String fileext = ".jpg"; 15 | String foldername = "./"; 16 | 17 | int max_display_size = 800; // viewing window size (regardless image size) 18 | 19 | boolean do_hsb = false; // do operate on HSB channels 20 | 21 | // logic below 22 | 23 | float scalingfactorin; 24 | float scalingfactorout; 25 | 26 | final static float sqrt05 = sqrt(0.5); 27 | 28 | float[] raw, raw1,raw2,raw3; 29 | float[] in, w, out; 30 | float[] in1,in2,in3,out1,out2,out3; 31 | int n,n2,s; 32 | 33 | boolean option1 = true; 34 | float sc = 160; 35 | 36 | PImage img; 37 | 38 | // working buffer 39 | PGraphics buffer; 40 | 41 | String sessionid; 42 | 43 | void setup() { 44 | sessionid = hex((int)random(0xffff),4); 45 | img = loadImage(foldername+filename+fileext); 46 | 47 | buffer = createGraphics(img.width, img.height); 48 | buffer.beginDraw(); 49 | buffer.background(0); 50 | buffer.noStroke(); 51 | buffer.endDraw(); 52 | 53 | // calculate window size 54 | float ratio = (float)img.width/(float)img.height; 55 | int neww, newh; 56 | if(ratio < 1.0) { 57 | neww = (int)(max_display_size * ratio); 58 | newh = max_display_size; 59 | } else { 60 | neww = max_display_size; 61 | newh = (int)(max_display_size / ratio); 62 | } 63 | 64 | size(neww,newh); 65 | 66 | s = img.width*img.height; 67 | raw = new float[s*3]; 68 | raw1 = new float[s]; 69 | raw2 = new float[s]; 70 | raw3 = new float[s]; 71 | 72 | if(do_hsb) colorMode(HSB,255); else colorMode(RGB,255); 73 | 74 | int iter=0; 75 | int iter2 = 0; 76 | for(int y=0;y127?hue(c)-256:hue(c); 82 | g = saturation(c)>127?saturation(c)-256:saturation(c); 83 | b = brightness(c)>127?brightness(c)-256:brightness(c); 84 | } else { 85 | r = red(c)>127?red(c)-256:red(c); 86 | g = green(c)>127?green(c)-256:green(c); 87 | b = blue(c)>127?blue(c)-256:blue(c); 88 | } 89 | raw[iter++] = r; 90 | raw[iter++] = g; 91 | raw[iter++] = b; 92 | raw1[iter2] = r; 93 | raw2[iter2] = g; 94 | raw3[iter2] = b; 95 | iter2++; 96 | } 97 | } 98 | 99 | n = (int)pow(2,ceil(log(s*3)/log(2))); 100 | n2 = (int)pow(2,ceil(log(s)/log(2))); 101 | 102 | in = new float[n]; 103 | w = new float[n]; 104 | out = new float[n]; 105 | out1 = new float[n2]; 106 | out2 = new float[n2]; 107 | out3 = new float[n2]; 108 | in1 = new float[n2]; 109 | in2 = new float[n2]; 110 | in3 = new float[n2]; 111 | 112 | arrayCopy(raw,0,in,0,raw.length); 113 | for(int i=raw.length;i// 198 | } 199 | if(option1) println("channels combined: " + str1); 200 | else println("channels separated: " + str2); 201 | } 202 | 203 | void printScale() { 204 | println("Scale: 0.."+sc); 205 | } 206 | 207 | void keyPressed() { 208 | if(keyCode == 32) { 209 | option1 = !option1; 210 | printOption(); 211 | } else if(keyCode == ENTER || keyCode == RETURN) { 212 | if(sc < 10) sc = 10; 213 | else if(sc<100) sc *=2; 214 | else if(sc<1000) sc+=200; 215 | else sc = 1; 216 | printScale(); 217 | } 218 | } 219 | 220 | void mouseClicked() { 221 | buffer.save(foldername + filename + "/res_" + sessionid + hex((int)random(0xffff),4)+"_"+filename+fileext); 222 | println("image saved"); 223 | } 224 | 225 | void wbtrafo(float[] y, int n) { 226 | float[] d = new float[n]; 227 | d[n-2] = w[n-1]; 228 | int b1 = n-4; 229 | int b2 = n-2; 230 | int a=1; 231 | while(a0) { 260 | for(int i=0;i0) w[n-1] = (int)(w[n-1]/scalingfactorin+0.5); 272 | else w[n-1] = (int)(w[n-1]/scalingfactorin-0.5); 273 | } 274 | --------------------------------------------------------------------------------