anthony wrote:mogrify Only if you can avoid generating and compositing an extra image.
which is imposible the way you have it due to the composition blur.
But you can DIY a convert loop to do a directory of images.
http://www.imagemagick.org/Usage/basics/#mogrify_not
Yes this is already what I'm doing...
Here is the command I use:
Code: Select all
for i in *.jpg; do ./sig3.sh $i; done
anthony wrote:
You may be able to if you replace the blurred composition, with a compose using the new 'variable blur mask' image.
http://www.imagemagick.org/Usage/compose/#blur
This is NEW, only present in the very latest releases.
It seems to be very interesting but it need a mask.
As a photographer, I don't have time to make those mask. When I do wedding pictures, people want them as fast as possible and I cannot afford to play with masks and so on. That's why my actual solution is terrific, but very slow
anthony wrote:
Actually it may
As it is fixed it can be a separate image which you can then be applied with the -draw compose method. That is the only compose method that works with "mogrify" as the second image MUST be an external image, and thus a fixed image. Another fixed external image with a draw compose can overlay a semit-transparent black, ir a 'light' image to draken the blurred edge/
As for the merger of the two commands I don't see why you can't, as long as you already know the 'width' of the image. The second convert command generates a word wrapped caption, though from the example a label: would work just as well.
You would just generate the caption in a parenthesis, then compose it into the space generated.
Rather than generate that space separately however I would simply append the generated caption image!
I don't get you
can you explain that part a bit more ? can you show me an example of this ? Thanks alot !
anthony wrote:
For a mogrify version you again need to avoid creating a second image, You create a 'black' space, but then do a 'annotate' into that space. Unfortunately that means you have to use a 'fixed' pointsize, rather than getting IM to work out an appropriate pointsize to fit the black space
That I think my be the biggest killer, for a mogrify version.
I wanted to use mogrify because I don't create new images, I modify those existing.
If it's not possible it's not a problem, convert will do it also
for the pointsize, I don't get you, you mean that I can automatically get the text to fit into the box with specifying the pointsize ? That would be really really really great !!!
anthony wrote:Now go for it!
Yes yes that's what I'm doing
I already made 5 scripts, those 5 scripts are very useful and I would like to improve them and be as good as you when I see your examples!
Just for your information, this is the kind of script I do:
Code: Select all
#!/bin/sh -x
# http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=12114&start=15
IMAGE=$1
CAPTION="La Place De Mons"
POINTSIZE="68"
STROKEWIDTH="0"
BORDERPC="3"
RECTWIDTH="100"
RESIZETO="1024"
FONT="./comics.pfb"
width=`identify -format "%w" $IMAGE`
heigth=`identify -format "%h" $IMAGE`
BORDERWIDTH=$( echo "scale=4;($BORDERPC/100*$width)"|bc)
tmpw=$( echo "scale=4;($BORDERWIDTH-1)"|bc)
convert $IMAGE \( +clone -blur 0x10 +level 20%,100% -fill black -colorize 30% \) \
\( +clone -gamma 0 -shave "$BORDERWIDTH"x"$BORDERWIDTH" \
-bordercolor white -border "$BORDERWIDTH"x"$BORDERWIDTH" \) \
-composite \
\( +clone -gamma 0 -shave "$BORDERWIDTH"x"$BORDERWIDTH" \
-bordercolor white -border 1x1 \
-bordercolor black -border "$tmpw"x"$tmpw" \) \
-compose screen -composite \
$IMAGE
convert -background '#0000' -fill white -gravity East -size ${width}x$RECTWIDTH \
-font $FONT -strokewidth $STROKEWIDTH -pointsize $POINTSIZE caption:"`echo $CAPTION`" \
+size $IMAGE +swap -gravity south -composite $IMAGE
mogrify -strip -quality "85%" -resize "${RESIZETO}x" $IMAGE
What do you think ?
Thanks for you precious help and time !