Friday, January 29, 2010

ProcessingとJava Image Filters(pixels)を使用してChannelMixFilterを適用する

より新しいバージョンでの記事「Processing3.4とJava Image Filtersを使用してChannelMixFilterを適用する」を参照してください。

ProcessingとJava Image Filters(pixels)を使用してChannelMixFilterを適用するには、以下のコードを実行します。Java Image Filtersはhttps://pixels.dev.java.net/servlets/ProjectDocumentListから pixels-core-2.1.3-SNAPSHOT.jarをダウンロードしてSketchのフォルダのcodeサブフォルダに配置するか、 Sketch->Add FilesメニューからSketchに追加します。


// キャンバスサイズ
PImage img = loadImage("SF.JPG");
size(img.width, img.height);
// ChannelMixFilterを適用する
ChannelMixFilter cmf = new ChannelMixFilter();
cmf.setBlueGreen(128);
cmf.setIntoR(255);
PImage img2 = new PImage(cmf.filter((BufferedImage)img.getImage(), null));
image(img2, 0, 0);
// ファイル保存
save("sample1475a.png");


元画像(sf.jpg):dataサブディレクトリに配置か、Add Filesで追加。


出力画像(sample1475a.png)
ProcessingとJava Image Filters(pixels)を使用してChannelMixFilterを適用した画像

動作環境
Processing 1.0.7

〇関連項目
・Processingをインストールした仮想マシンを構築するには、以下のページを参照してください。
https://serverarekore.blogspot.com/search/label/Processing

・Processingに関する他の記事は、こちらを参照してください。

No comments: