I know that there are a lot of topics about this, but none really fits into my problem. I need the attached image (link) divided into multiple sub-images and I search for the easiest way to do this.
The image should be saveable. I tried BufferedImage, which lacks a useful constructor for this.
It doesn't have to be java. A simple tool who can do this would also do the job. Note: I have to get ~567 images out of one. I found "online image-splitters", but none was able to split the image into more than 32 parts.
final BufferedImage source = ImageIO.read(new File("<sourceDir>/1fby-6t-555d.png"));
int idx = 0;
for (int y = 0; y < source.getHeight(); y += 32) {
ImageIO.write(source.getSubimage(0, y, 32, 32), "png", new File("<sourceDir>/1fby-6t-555d_" + idx++ + ".png"));
}
:)
Output:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With