admin管理员组文章数量:1516870
图片模糊化处理
import acm.graphics.*;
import acm.program.*;
import acm.util.RandomGenerator;public class Beeperline extends GraphicsProgram { //马赛克public void run() {//获取图片GImage img = new GImage("C:\\Users\\Administrator\\Pictures\\egal.jpg");int[][] ps = img.getPixelArray();for(int i=0; i<ps.length-10; i+=10) for(int j=0; j<ps[i].length-10; j+=10) {int temp = ps[i][j];for(int r=i; r<i+10; r++)for(int c=j; c<j+10; c++) ps[r][c]=temp;}img=new GImage(ps);add(img,0,0);RandomGenerator a=new RandomGenerator();println(a.nextInt(0,ps.length-1));println(a.nextInt(0,ps[0].length-1));}
}
本文标签: 图片模糊化处理
版权声明:本文标题:图片模糊化处理 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/biancheng/1707334406a716580.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论