sclass Image332 { int w; byte[] pixels; *() {} // for persistence *(RGBImage img) { w = img.getWidth(); int h = img.getHeight(); pixels = new byte[w*h]; for y to h: for x to w: pixels[y*w+x] = to332(img.getInt(x, y)); } int h() { ret l(pixels)/w; } RGBImage toRGB() { int h = h(); RGBImage img = new RGBImage(w, h); for y to h: for x to w: img.setPixel(x, y, from332(pixels[y*w+x])); ret img; } }