Java - Color2Gray


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public BufferedImage toGray(BufferedImage bi)
  2. {
  3. ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
  4. ColorConvertOp op = new ColorConvertOp(cs, null);
  5.  
  6. return op.filter(bi, null);
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.