A class that provides the ability to work with color images in P3 format.
NB: The format is raw text.
Note:
This class supports indexing and assigning values to specific pixels via 1D or 2D indexing, and provides P3 file loading/saving capabilities.
According to the accepted convention, in the original description of the format inside the Netpbm package, the extension of these files should be *.ppm.
Typical usage:
// creating of empty imageautoimg = newP3Image;
// load image from file `Lenna.ppm`img.load(`Lenna.ppm`);
// change pixel at coords (10; 10), now are whiteimg[10, 10] = newRGBColor(255, 255, 255);
// get color of 11th pixelimg[10].writeln;
// save file as `Lenna2.ppm`img.save(`Lenna2.ppm`);
// creating image of 10x10, all pixels are redautoimg2 = newP3Image(10, 10, newRGBColor(255, 0, 255));
// increasing luminance by twoimg2[10] = img2[10] * 2;
// save as `test.ppm`img2.save(`test.ppm`);
A class that provides the ability to work with color images in P3 format. NB: The format is raw text.
Note: This class supports indexing and assigning values to specific pixels via 1D or 2D indexing, and provides P3 file loading/saving capabilities. According to the accepted convention, in the original description of the format inside the Netpbm package, the extension of these files should be *.ppm.
Typical usage: