for (int y = 0; y < h1; ++y)
image1.setRGB(x, y, gray);
// convert image1 to a picture and then back to image2
IVideoPicture picutre = converter1.toPicture(image1, 0);
BufferedImage image2 = converter2.toImage(picutre);
assertEquals("image2 wrong width", w2, image2.getWidth());
assertEquals("image2 wrong height", h2, image2.getHeight());