Page 1 of 1

using convert to convert an ascii text to an image trouble

Posted: 2007-07-06T09:03:23-07:00
by McRib

Code: Select all

#!/bin/bash

OUTPUT=`mycommand`
convert -size 100x65 xc:lightblue -font Courier -pointsize 8 \
           -annotate +0+8 "$OUTPUT" -depth 1  -
running the script gives me:

Code: Select all

convert: no encode delegate for this image format `-'.
Writing to a file works, but I would prefer holding the data in the script...

I also need access to the pixels and would prefer something raw. The device that should get the output needs a special treatment:

ABCD -- where each letter stands for one pixel with 2 bits color depth

DCBA -- is what the devices likes to see :-/

Is Imagemagick able to provide should a fancy format ? If not - how close can I get to it ?

Re: using convert to convert an ascii text to an image trouble

Posted: 2007-07-09T17:55:22-07:00
by anthony
You did not specify what format to use for the output! As the base image was initernally generated IM has no fallback to use.

Replace - with maybe png:- for a PNG format image, output to standard output.

See IM Examples, Image File Handling, Saving Images
http://www.imagemagick.org/Usage/files/#save
In fact you may find the first three sections of IM examples essential reading.