Hey guys, could you please help me convert this to java? use Image::Magick; my @x_coords = qw(0 100 200); my @y_coords = qw(0 90); my $source_image = Image::Magick->new(); $source_image->Read("source_image.gif"); for (my $x = 0; $x < @x_coords; $x++) { my $x_at_right = $x == $#x_coords ? $source_image->Get('columns') : $x_coords[$x + 1]; for (my $y = 0; $y < @y_coords; $y++) { my $y_at_bottom = $y == $#y_coords ? $source_image->Get('height') : $y_coords[$y + 1]; my $x_coord = $x_coords[$x]; my $y_coord = $y_coords[$y]; my $width = $x_at_right - $x_coord; my $height = $y_at_bottom - $y_coord; my $sub_image = $source_image->Clone(); $sub_image->Crop(x => $x_coords[$x], y => $y_coords[$y], width => $width, height => $height); my $section_fname = "sections-x$x-y$y.gif"; $sub_image->Write($section_fname); } } Code (markup): Or create something to do this: I need to divide up a BufferedImage (or just a regular Image) in java into multiple images based on my discretion. I can provide the coordinates to divide them at, but how do you suggest I divide up the Image? (The images will be of different sizes, but all will fit together (no part of the image will be left out). For example (the image could be divided up like this): Thank you!