Bitmap/Read an image through a pipe: Difference between revisions
Content added Content deleted
m (→{{header|C}}: lazyness of the others is not a meter to request improvements; dependencies are like the salt; afaik there's no need of being short and self contained) |
No edit summary |
||
Line 159: | Line 159: | ||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
<lang PicoLisp>(setq *Ppm (ppmRead '("convert" "img.jpg" "ppm:-")))</lang> |
<lang PicoLisp>(setq *Ppm (ppmRead '("convert" "img.jpg" "ppm:-")))</lang> |
||
=={{header|Racket}}== |
|||
<lang racket> |
|||
(define (image->bmp filename) |
|||
(define command (format "convert ~a ppm:-" filename)) |
|||
(match-define (list in out pid err ctrl) (process command)) |
|||
(define bmp (read-ppm in)) |
|||
(close-input-port in) |
|||
(close-output-port out) |
|||
bmp) |
|||
(image->bmp "input.jpg")</lang> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |