public void resize() {
		if (width == trimWidth && height == trimHeight) {
			return;
		}
		byte image[] = new byte[trimWidth * trimHeight];
		int off = 0;
		for (int offY = 0; offY < height; offY++) {
			for (int offX = 0; offX < width; offX++) {
				image[offX + offsetX + (offY + offsetY) * trimWidth] = pixels[off++];
			}
		}
		pixels = image;
		width = trimWidth;
		height = trimHeight;
		offsetX = 0;
		offsetY = 0;
	}