Grayscale image: Difference between revisions

Content added Content deleted
Line 636: Line 636:
(*------------------------------------------------------------------*)
(*------------------------------------------------------------------*)
</syntaxhighlight>
</syntaxhighlight>

There is a test program, which can be compiled and run as follows:
<pre>$ patscc -std=gnu2x -g -O2 -DATS_MEMALLOC_LIBC -DATS BITMAP_GRAYSCALE_TASK_TEST bitmap{,_{write_ppm,grayscale}}_task.{s,d}ats -lm
$ ./a.out</pre>

It expects raw 24-bit color data in a file called <code>4.2.07.raw</code>. I have data from the SIPI test image "Peppers" in that file. Output will be three files, named <code>image-color.ppm</code>, <code>image-gray.pgm</code>, and <code>image-gray.ppm</code>. The first is "Peppers" as a PPM image, the second is the grayscale conversion as a PGM image, and the last is the grayscale conversion converted to a PPM image.

{{out}}
[[File:Bitmap grayscale task ATS color.jpg|thumb|none|alt=Bell peppers in different colors.]]
[[File:Bitmap grayscale task ATS gray.jpg|thumb|none|alt=Bell and other peppers in grayscale.]]


=={{header|BASIC256}}==
=={{header|BASIC256}}==