processing图片处理相关.pptVIP

  • 3
  • 0
  • 约小于1千字
  • 约 8页
  • 2018-12-23 发布于湖北
  • 举报
processing图片处理 processing图片处理 能载入图片,显示; 能处理图片的每一个像素。 点画效果的实现 载入图片; 随机获取像素; 将像素的位置画一个圆点。 代码分析 加载库 PImage photo; 载入图片 photo=loadImage(wzms.jpg); 显示图像 image(photo, 0, 0); 载入网络图片 PImage online; void setup() { String url = /img/processing_beta_cover.gif; online = loadImage(url, png); noLoop(); } void draw() { image(online, 0, 0); } 代码分析—像素处理 int x=int(random(photo.width));//随机选取一个像素0-图片宽度 int y=int(random(photo.height));//随机选取一个像素0-图片高度 int xy=x+y *photo.width; loadPixels(); float r=red(photo.pixels[xy]); float g=green(photo.pixels[xy]); float b=blue(photo.pixels[xy]); * * *

文档评论(0)

1亿VIP精品文档

相关文档