Write the code for the following given method that transforms animage. The original image (args[0]) has 1536 rows x 1819 columns.The collage resulting from the constructor on the left has 400 rowsby 400 columns.
ArtCollage art = new ArtCollage(args[0]);art.showCollagePicture();
Here are the given codes:
import java.awt.Color;
public class ArtCollage {
// The orginal picture
private Picture original;
// The collage picture
private Picture collage;
// The collage Picture consists of collageDimension XcollageDimension tiles
private int collageDimension;
// A tile consists of tileDimension X tileDimension pixels
private int tileDimension;
/*
* One-argument Constructor
* 1. set default values of collageDimension to 4 andtileDimension to 100
* 2. initializes original with the filenameimage
* 3. initializes collage as a Picture oftileDimension*collageDimension xtileDimension*collageDimension,
* where each pixel is black (see all constructors forthe Picture class).
* 4. update collage to be a scaled version of original(see scaling filter on Week 9 slides)
*
* @param filename the image filename
*/
public ArtCollage (String filename) {
// WRITE YOUR CODE HERE
}
Expert Answer
Answer to Write the code for the following given method that transforms an image. The original image (args[0]) has 1536 rows x 181…