I have a size image won h. In Java, I need to create an image the size w h+20where the top one wis 20 pixelswhite and the rest of the image is the same as the original image.
Essentially, I want to know how to add 20 pixels of white to the top of an existing buffered image.
So it would be something like:
public static void main (String[] args) {
BufferedImage originalImage = [the original image with a specific file path];
...code to create a new image 20 pixels higher...
...code to paint originalImage 20 pixels down on the new image
...code to save the new image...
}
source
share