I have an assignment that requires me to write a program that reads in an image given at the command line (image is saved in the project folder prior to running the program), then tile and change the colours around on the image and save this new file with a -tiled
suffix.
The only thing I could find on Stack Overflow was to use the renameTo
method but it is undefined for the type BufferedImage
which the variable 'inputfile' is, therefore this current code will not compile.
File outputfile = inputfile.renameTo(inputfile + "-tiled");
try {
ImageIO.write(inputfile1, "png", outputfile);
} catch (IOException e) {
e.printStackTrace();
}
What is a better way to do this?