Daily Creative Coding

元「30 min. Processing」。毎日、Creative Codingします。

画像処理

blurを繰り返しかける

/** * blur blur blur * * @author aa_debdeb * @date 2016/02/27 */ void setup(){ size(500, 500); frameRate(30); } void initialize(){ background(random(255), random(255), random(255)); stroke(random(255), random(255), random(255)); strokeWeig…

画像からドロネー図をつくる

入力画像 出力画像 入力画像を工夫しないと上手くいかない. /** * Image by Delaynay Triangulation * * @author aa_debdeb * @date 2015/12/13 */ Delaynay delaynay; void setup(){ size(540, 360); smooth(); noLoop(); PImage image = loadImage("photo…

画像を鮮鋭化(アンシャープ化)する

入力画像 出力画像 /** * Unsharp Masking * * @author aa_debdeb * @date 2015/12/01 */ void setup(){ size(512, 512); noLoop(); PImage image = loadImage("blur_lena.jpg"); image(image, 0, 0); int winSize = 5; int halfWinSize = winSize / 2; prin…

周辺光量落ち

/** * Decrease in the peripheral light quantity * * @author aa_debdeb * @date 2015/11/06 */ void setup(){ size(640, 424); PImage image = loadImage("image.jpg"); image(image, 0, 0); noFill(); stroke(0); strokeWeight(1); for(int i = 0; i < 4…

パッチワークで画像を再構成する

/** * Patchwork Image * * @author aa_debdeb * @date 2015/10/30 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] colors = new color[width][height]; for(int x = 0; x < width; …

画像処理の基礎3

画像を重ねる(多重露光する) /** * Multiple Exposure * * @author aa_debdeb * @date 2015/10/29 */ void setup(){ size(640, 424); PImage image1 = loadImage("image1.jpg"); PImage image2 = loadImage("image2.jpg"); image(image1, 0, 0); tint(255,…

画像をファミコン風にする

/** * Image Like Super NES * * @author aa_debdeb * @date 2015/10/28 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); int cLevel = 5; int levelStep = 255 / cLevel; for(int x = 0; x < w…

画像処理の基礎2

画像の色を反転する /** * Reversed Color Image * * @author aa_debdeb * @date 2015/10/27 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); for(int x = 0; x < width; x++){ for(int y = 0; …

画像から点描画をつくる

/** * Pointilism Image * * @author aa_debdeb * @date 2015/10/26 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] colors = new color[width][height]; for(int x = 0; x < width;…

画像のエッジを検出する(Sobelフィルター)

/** * Edge Detection by Sobel Filter * * @author aa_debdeb * @date 2015/10/23 */ PImage image; void setup(){ size(512, 512); noStroke(); image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] greys = new color[width][he…

画像をぼかす

/** * Blurred Image * * @author aa_debdeb * @date 2015/10/24 */ int blurWidth = 15; void setup(){ size(512, 512); noStroke(); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] colors = new color[width][heigh…

画像処理の基礎1

画像を表示する /** * Display Image * * @author aa_debdeb * @date 2015/10/23 */ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); 画像に色をつける /** * Tint Image * * @author aa_debdeb * @date 2015/10/23 */ PImage i…