For creating of self framed picture you can find a description in the usage pages of ImageMagick
I had improved the first example bit and put everything in a script "selfframe" so that I can apply it easyly on a picture. You find the script at the bottom.
The script is called with one parameter, the name of the picture. It uses only one convert command which does the following:
You can do some more adjustments to the underlying frame. For example you could convert it to b/w with -modulate 100,0,100 before adding the border or blur it several times.
Here comes the script:
#!/bin/bash
# selfframe
# creating a self framed picture
DEBUG="ON"
For creating of self framed picture you can find a description in the usage pages of ImageMagick
I had improved the first example bit and put everything in a script "selfframe" so that I can apply it easyly on a picture. You find the script at the bottom.
The script is called with one parameter, the name of the picture. It uses only one convert command which does the following:
You can do some more adjustments to the underlying frame. For example you could convert it to b/w with -modulate 100,0,100 before adding the border or blur it several times.
Here comes the script:
#!/bin/bash
# selfframe
# creating a self framed picture
DEBUG="ON"
PICTURE="$1"
PDIR=`dirname ${PICTURE}`
PNAME=`basename ${PICTURE}`
if [ $DEBUG = "ON" ]
then
echo "Picture=${PICTURE}"
echo "PDIR=${PDIR}"
echo "PNAME=${PNAME}"
fi
convert ${PICTURE} \
\( -clone 0 -resize 130% +level 20%x100% \
-blur 0x20 -bordercolor black -border 10x10 \) \
\( -clone 0 -bordercolor black -border 10x10 \) \
-delete 0 -gravity center -composite "$PDIR/sf_${PNAME}"
To create the calender-page I used the followin script, which creates the ImageMagick "convert"-command. The picture is created with following command:
convert 2009 1 bild.jpg | sh
#!/bin/sh
[ $# -lt 3 ] && echo "usage calender YEAR MONTH PICTURE" && exit 1
YEAR=${1}
MONTH=${2}
PICTURE=${3}
# Get width and height of the picture
W=`identify -format "%w" ${PICTURE}`
H=`identify -format "%h" ${PICTURE}`
# Define the number of days in a mmonth
DINM=(31 28 31 30 31 30 31 31 30 31 30 31)
# Define the names ot the days
NOFD=(So Mo Di Mi Do Fr Sa)
NOFM=(Januar Februar März April Mai Juni Juli August September Oktober November Dezember)
PREFIX="ip"
FONT="Andy MT"
PTSIZE=$((H/40))
SIGN="© 2008,2009 by Byggvir of Barley"
echo -e "convert \\"
echo -e "-gravity North \\"
echo -e "-pointsize 128 -family \"$FONT\" \\"
echo -e "-fill Black -draw 'text 32,8 \"${NOFM[$((MONTH-1))]} $YEAR\"' \\"
echo -e "-fill Lightgrey -draw 'text 31,7 \"${NOFM[$((MONTH-1))]} $YEAR\"' \\"
echo -e "-gravity SouthEast \\"
echo -e "-pointsize 16 -family \"$FONT\" \\"
echo -e "-fill Black -draw 'text 32,8 \"$SIGN\"' \\"
echo -e "-fill Lightgrey -draw 'text 31,7 \"$SIGN\"' \\"
echo -e "-gravity NorthWest \\"
echo -e "-pointsize $PTSIZE -family \"$FONT\" \\"
for (( d=1 ; d <= DINM[MONTH-1] ; d++ ))
do
X=$((W*(2*d-1)/2/(DINM[MONTH-1]+1)))
Y=$((H-3*PTSIZE-5))
WDAY=${NOFD[`date +%w -d "$YEAR-$MONTH-$d"`]}
case "$WDAY" in
So) COLOR=Red ;;
Sa) COLOR=MediumVioletRed ;;
* ) COLOR=Lightgrey ;;
esac
echo "-fill Black -draw 'text $X,$Y \"$WDAY\"' \\"
echo "-fill $COLOR -draw " "'text $(($X-1)),$(($Y-1)) \"$WDAY\"' \\"
Y=$((H-2*PTSIZE))
echo "-fill Black -draw 'text $X,$Y \"$d\"' \\"
echo "-fill $COLOR -draw 'text $(($X-1)),$(($Y-1)) \"$d\"' \\"
done
echo "${PICTURE} ${PREFIX}-${PICTURE}"
Eine kleine GIF Spielerei, die leider nur mit dem Original funktioniert, weil die anderen Größen nach jpg konvertiert werden.
Mit einem kleinen Programm Zufallszahlen für die Rechteck erzeugt, daraus s/w Masken mit ImageMagic erstellt. Die einzelnen Masken über das Original gelegt, und die Einzelbilder zur GIF-Animation zusammengefügt.
C-Programm für die Zufallszahlen
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
int main(int argc, char *argv[ ]) {
int zahl , anzahl, i , j;
int max[256];
if (argc > 1 ) {
anzahl = atoi(argv[1]);
for (j=2;j<argc;j++) {
max[j-2]=atoi(argv[j]);
}
}
else {
anzahl = 1;
}
srand(time(NULL));
for (i=0;i<anzahl; i++ ) {
for (j=0;j<argc-2;j++) {
zahl = rand() % max[j];
printf("%d ", zahl);
}
printf("\n");
}
}
Script zur Maskenerzeugung
#!/bin/sh
DRAW=""
W=1200
H=800
J=0
read x y w h r g b
while [ $x ]
do
DRAW=" -fill white -draw 'rectangle ${x},${y} $((x+w+300)),$((y+h+300))'"
echo convert -size ${W}x${H} xc:black $DRAW fenster-`printf %4.4d $J`.png
read x y w h r g b
J=$((J+1))
done
Befehle an der Unix-Shell
zufallszahl 10 300 200 140 100 | fenster | sh
for B in fenster*.png; do convert -composite -compose multiply $B back.jpg x-$B; done
convert -delay 100 x-*.png -loop 0 x.gif
[EN] If the exposure time is long enough, you can with a zoom lens during the opening time zoom in or out. If you use a flash also you will get pictures as shown here.
[DE] Wenn die Belichtungszeit lange genug ist, kann man während der Verschluss geöffnet ist bei einem Zoomobjektiv ein- oder auszoomen. Wenn man zusätzlich den Blitz einsetzt entstehen Bilder wie das hier gezeigte.
[EN] If, then!ybr />
If you can't get your pictures quite sharp, why focus properly? Yesterday at "Kultur im Hof (culture in the yard)" I played a little with flash, exposure time and zoom. Here is the result of a long exposure time during which I zoomed out and flashed on the back.Fortunately the waitress went on position and the flashlight depicted her sharp.
[DE] Wenn schon, denn schon.
Wenn die Bilder schon nicht ganz scharf werden, warum denn nicht gleich richtig unscharf? Gestern bei "Kultur im Hof" hab ich etwas mit Blitz, Belichtungszeit und zoom gespielt. Hier das Ergebnis einer langen Belichtungszeit während der ausgezoomt wurde und der Blitz auf dem hinteren Verschlussvoprhang auslöste.Netterweise begab sich die Bedienung während des ganzen auf Position und wurde durch den Blitz scharf abgebildet.
[EN]This Picture was manipulated with The GIMP. After some tries I found a way to seperate the red Cola tin realitive quickly. Here are the steps (I'm using the German version, so the Translation may differ:
[EN]
[DE] Diese Bild wurde mit GIMP bearbeitet. Hier die Schritte, wie es gemacht wurde.