ImageMagick command - PoshHsu/0xf8c3b00k GitHub Wiki

Preface

0xfb reads image data from standard input, which can easily cooperate with powerful command line-based image tools, ImageMagick is important one of them.

Send JPEG formatted image to standard output

To make ImageMagick to output to standard output, just put a dash '-' in the field of output filename. For 0xfb, one also need to specify the output type, as 0xfb uses JPEG format to upload image.

$ convert YourPhoto.jpg jpeg:- | ./0xfb uploadphoto -m 'Wow, cool 0xfb'

jpeg:- means that result image will be send to standard output using JPEG format.

Shrink and add a frame to you picture

ImageMagick itself of course pipelined. To build a photo that easy to share, we may shrink it, add a frame on it then upload it to facebook. It can be easily done by command in one line.

$ convert ~/t/P1000186.JPG -resize 800x800\> - | convert - -frame 10x10+3+3 jpeg:- | ./0xfb uploadphoto

Drawing text

ImageMagick can even produce text image, here's an example:

$ convert -background lightblue  -fill blue  -font Arial-Black-Normal \
    -pointsize 32 -size 320x100  -gravity South caption:"Yeah, It's 0xfb" \
    jpeg:- | ./0xfb uploadphoto

Another example:

$ convert -size 320x85 canvas:none -font Sinhala-MN-Regular -pointsize 72 \
    -draw "text 25,60 'Magick'" -channel RGBA -blur 0x6 -fill darkred -stroke \
    magenta -draw "text 20,55 'Magick'" jpeg:- | ./0xfb uploadphoto

References