Skip to content

Instantly share code, notes, and snippets.

@Costava
Created February 10, 2022 00:36
Show Gist options
  • Save Costava/5392491520fa3ad9b845da349979023a to your computer and use it in GitHub Desktop.
Save Costava/5392491520fa3ad9b845da349979023a to your computer and use it in GitHub Desktop.
// Output to stdout a solid red P3 .ppm image.
public class SolidRed {
public static void main(String args[]) {
int width = 100;
int height = 100;
int numPixels = width * height;
System.out.println("P3");
System.out.println(width + " " + height);
System.out.println("255");
for (int i = 0; i < numPixels; i += 1) {
System.out.println("255 0 0");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment