static L bufferedImageHorizontalSlices(double sliceWidth, BufferedImage img) { new L out; int w = img.getWidth(), h = img.getHeight(); for (double x = 0; iround(x) < w; x += sliceWidth) { int actualX = iround(x), nextX = min(w, iround(x+sliceWidth)); if (nextX > actualX) out.add(clipBufferedImage(img, rectFromPoints(actualX, 0, nextX, h))); } ret out; }