可能重复:
是否有用于隐写术的 Java 库?
public void myfunction()
{
try
{
BufferedImage image = ImageIO.read(new File("first.jpg"));//first image
BufferedImage overlay = ImageIO.read(new File("second.jpg"));//second image
int w = Math.max(image.getWidth(), overlay.getWidth());
int h = Math.max(image.getHeight(), overlay.getHeight());
BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
Graphics g = combined.getGraphics();
g.drawImage(image, 0, 0, null);
g.drawImage(overlay, 0, 0, null);
//here i combined 2 images in combined.jpg
ImageIO.write(combined, "jpg", new File("DestinationPath", "combined.jpg"));//combined image
}
catch (Exception e)
{
e.printStackTrace();
}
}
//我想把这个 combine.jpg 提取到我之前的 first.jpg 和 second.jpg 中?// 如何提取我与此代码组合的 2 个图像?