RosettaCodeData/Task/Bitmap-PPM-conversion-through-a-pipe/Mathematica/bitmap-ppm-conversion-through-a-pipe-1.math
2018-08-17 15:15:24 +01:00

7 lines
327 B
Text

convert[image_,out_]:=Module[{process=StartProcess[{
"wolfram","-noinit","-noprompt","-run",
"Export[FromCharacterCode["~~ToString[ToCharacterCode[out]]~~"],ImportString[StringRiffle[Table[InputString[],{4}],FromCharacterCode[10]],FromCharacterCode[{80,80,77}]]]"
}]},
WriteLine[process,image];
WriteLine[process,"Quit[]"];
];