List of utility methods to do BufferedImage Operation
BufferedImage | setBackgroud(BufferedImage image, Color backgroundColor) set Backgroud Graphics2D g2d = image.createGraphics();
g2d.setPaint(backgroundColor);
g2d.fillRect(0, 0, image.getWidth(), image.getHeight());
g2d.dispose();
return image;
|
void | setBGRPixels(byte[] bgrPixels, BufferedImage img, int x, int y, int w, int h) converts and copies byte packed BGR or ABGR into the img buffer, the img type may vary (e.g. int imageType = img.getType(); WritableRaster raster = img.getRaster(); if (imageType == BufferedImage.TYPE_3BYTE_BGR || imageType == BufferedImage.TYPE_4BYTE_ABGR || imageType == BufferedImage.TYPE_4BYTE_ABGR_PRE || imageType == BufferedImage.TYPE_BYTE_GRAY) { raster.setDataElements(x, y, w, h, bgrPixels); } else { int[] pixels; if (imageType == BufferedImage.TYPE_INT_BGR) { ... |
BufferedImage | setBrightnessFactor(BufferedImage img, float multiple, BufferedImage dest) set Brightness Factor float[] brightKernel = { multiple }; BufferedImageOp bright = new ConvolveOp(new Kernel(1, 1, brightKernel)); return bright.filter(img, dest); |
void | setColor(BufferedImage image, int x, int y, int[] color, String colorModel) set Color if (x < 0 || x >= image.getWidth() || y < 0 || y >= image.getHeight()) { return; WritableRaster raster = image.getRaster(); switch (colorModel) { case "CMY": case "CMYK": float[] rgb = cmykToRgb(1F * color[0] / 255, 1F * color[1] / 255, 1F * color[2] / 255); ... |
void | setCompressionType(ImageWriteParam param, BufferedImage image) Sets the ImageIO parameter compression type based on the given image. if (image.getType() == BufferedImage.TYPE_BYTE_BINARY && image.getColorModel().getPixelSize() == 1) { param.setCompressionType("CCITT T.6"); } else { param.setCompressionType("LZW"); |
void | setImageIntPixels(BufferedImage image, boolean allowDeoptimizingDirectRead, IntBuffer pixels) set Image Int Pixels setImageIntPixels(image, 0, 0, image.getWidth(null), image.getHeight(null), allowDeoptimizingDirectRead, pixels); |
void | setLockImage(BufferedImage image) Sets a small lock image to use when creating cycle buttons. lockImage = image; |
void | setLuminance(BufferedImage image, int x, int y, float value) set Luminance image.setRGB(x, y, new Color(value, value, value).getRGB());
|
void | setPixel(BufferedImage img, int x, int y, int c) set Pixel img.setRGB(x, y, c); |
void | setPoint(BufferedImage image, int x, int y, int factor, Color color) set Point for (int i = 0; i < factor; ++i) { for (int j = 0; j < factor; ++j) { image.setRGB(x * factor + i, y * factor + j, color.getRGB()); |