Bitmap/Read an image through a pipe: Difference between revisions
Bitmap/Read an image through a pipe (view source)
Revision as of 11:33, 9 November 2023
, 6 months ago→{{header|Wren}}: Fixed a potential timing issue with FileSystem.load.
(→{{header|Wren}}: Fixed a potential timing issue with FileSystem.load.) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 147:
<pre>$ myatscc bitmap_read_through_pipe_task.dats
$ ./bitmap_read_through_pipe_task 4.1.07.tiff >
$ file 4.1.07.ppm
4.1.07.ppm: Netpbm image data, size = 256 x 256, rawbits, pixmap
Line 717:
We can now use this plug-in in the following script which calls ''ImageMagick'' to convert the ''output_piped.jpg'' file to a ''ppm'' file so that we can load the latter, convert it to a gray scale image, display it and save it to a .jpg file.
<syntaxhighlight lang="
import "dome" for Window, Process
import "io" for FileSystem
Line 750:
loadPPMFile(fileName) {
var ppm = FileSystem.load(fileName)
var count = ppm.count //ensure file is fully loaded before proceeding
if (ppm[0..1] != "P6") {
System.print("The loaded file is not a P6 file.")
Line 799 ⟶ 800:
var Game = Bitmap.new("output_piped.jpg", "output_piped.ppm", "output_piped_gs.jpg", 350, 350)</syntaxhighlight>
=={{header|zkl}}==
{{trans|C}}
|