This simple code to produce a red output image will not work with JUCE 8 on Windows. It will always result in an “empty” image (black image with JPEG, transparent image with PNG).
It worked well with JUCE 7 on both Windows and Mac and also works with JUCE 8 on macOS.
Image image(Image::PixelFormat::RGB, 200, 200, true);
Graphics graphicsContext(image);
graphicsContext.setColour(Colours::red);
graphicsContext.fillRect(0, 0, image.getWidth(), image.getHeight());
File outputFile("<some path>/test.jpg");
FileOutputStream stream(outputFile);
JPEGImageFormat jpegFormat;
jpegFormat.writeImageToStream(image, stream);