Java BufferedImage Operation composite(BufferedImage bg, BufferedImage fg)

Here you can find the source of composite(BufferedImage bg, BufferedImage fg)

Description

composite

License

Open Source License

Declaration

public static BufferedImage composite(BufferedImage bg, BufferedImage fg) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Graphics;
import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage composite(BufferedImage bg, BufferedImage fg) {
        BufferedImage result = copyImage(bg);
        Graphics g = result.getGraphics();
        g.drawImage(fg, 0, 0, null);//w w w.  j  a  v a 2  s. c  o m
        g.dispose();
        return result;
    }

    public static BufferedImage copyImage(BufferedImage source) {
        BufferedImage b = new BufferedImage(source.getWidth(), source.getHeight(), source.getType());
        Graphics g = b.getGraphics();
        g.drawImage(source, 0, 0, null);
        g.dispose();
        return b;
    }
}

Related

  1. checkRadius(final BufferedImage src, final int x, final int y, final int opaqueLimit, final int radius)
  2. chunk(BufferedImage image)
  3. circularize(BufferedImage image)
  4. cleanBinaryImage(BufferedImage image)
  5. compose(BufferedImage image, BufferedImage mask)
  6. computeBrightnesses(final BufferedImage image)
  7. computeTrimmedBounds(BufferedImage image, Rectangle tbounds)
  8. conformImageToInt(BufferedImage in)
  9. contrast(BufferedImage src, float scaleFactor)