Re: Multiple writes and pipes in a single command
Posted: 2016-06-06T14:11:34-07:00
I think I found a workaround, not sure its the most efficient way of working, but this got the result that I want except that the transparent watermark background is white:
Code: Select all
#!/bin/sh
INPUTFILE='image.jpg'
MPRNAME='12345'
WATERMARK='MyWatermark.png'
ICCPROFILE='sRGB.icc'
ORIGINALSIZE=`identify $INPUTFILE | awk -F ' ' '{print $3}'`
HPRSIZE=$ORIGINALSIZE
LPRSIZE='2000x2000'
SCRSIZE='1100x1100'
PRESIZE='450x450'
THMSIZE='150x150'
COLSIZE='75x75'
convert $INPUTFILE -depth 8 -flatten \( $WATERMARK -write mpr:$MPRNAME +delete \) \
\( -size $HPRSIZE tile:mpr:$MPRNAME \) \
\( -clone 0 -clone 1 -compose dissolve -define compose:args=15 -composite \) \
-delete 1 -quality 82 -intent relative -black-point-compensation -profile $ICCPROFILE +profile "!iptc,*" -write mpr:$MPRNAME \
-delete 1 -write hpr.jpg +delete mpr:$MPRNAME -delete 0 -write hpr_wm.jpg +delete \
mpr:$MPRNAME -resize $LPRSIZE -write mpr:$MPRNAME \
-delete 1 -write lpr.jpg +delete mpr:$MPRNAME -delete 0 -write lpr_wm.jpg +delete \
mpr:$MPRNAME -resize $SCRSIZE -write mpr:$MPRNAME \
-delete 1 -write scr.jpg +delete mpr:$MPRNAME -delete 0 -write scr_wm.jpg +delete \
mpr:$MPRNAME -resize $PRESIZE -write mpr:$MPRNAME \
-delete 1 -write pre.jpg +delete mpr:$MPRNAME -delete 0 -write pre_wm.jpg +delete \
mpr:$MPRNAME -resize $THMSIZE -write mpr:$MPRNAME \
-delete 1 -write thm.jpg +delete mpr:$MPRNAME -delete 0 -write thm_wm.jpg +delete \
mpr:$MPRNAME -resize $COLSIZE -write mpr:$MPRNAME \
-delete 1 -write col.jpg +delete mpr:$MPRNAME -delete 0 col_wm.jpg