A class that provides the ability to work with color images in P5 format.
NB: The format is raw binary.
Note:
This class supports indexing and assigning values to specific pixels via 1D or 2D indexing, and provides P5 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 *.pgm.
Typical usage:
// create empty imageautoimg = newP5Image;
// load from file img.load(`Lenna.pgm`);
// set pixel at (10;10) to white colorimg[10, 10] = newRGBColor(255, 255, 255);
// get color of 11th pixel img[10].writeln;
// save to fileimg.save(`Lenna2.pgm`);
// creating image of size 10x10, all pixels blackautoimg2 = newP5Image(10, 10, newRGBColor(0, 0, 0));
// increase luminance twiceimg2[10] = img2[10] * 2;
// save as pgm file img2.save(`test.pgm`);
A class that provides the ability to work with color images in P5 format. NB: The format is raw binary.
Note: This class supports indexing and assigning values to specific pixels via 1D or 2D indexing, and provides P5 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 *.pgm.
Typical usage: