Patterning an image?
Posted: 2018-12-16T16:35:48-07:00
Version: ImageMagick 7.0.8-16 Q16 x86_64 2018-12-10
Hey all I'm new to using image magick. So far I've been dabbling with bash scripts utilizing it. Currently I'm having issues trying to to use a sample/pattern of the top left 100x100 pixels to pattern across the rest of the image. The finishing result looks distorted, the colors look wrong, and it looks really bad. I assume resaving a jpg over and over causes a lot of artifacts. Help?
Here's my bash script:
Hey all I'm new to using image magick. So far I've been dabbling with bash scripts utilizing it. Currently I'm having issues trying to to use a sample/pattern of the top left 100x100 pixels to pattern across the rest of the image. The finishing result looks distorted, the colors look wrong, and it looks really bad. I assume resaving a jpg over and over causes a lot of artifacts. Help?
Here's my bash script:
Code: Select all
#!/bin/bash
width=$(identify -ping -format '%w' $1[0])
height=$(identify -ping -format '%h' $1[0])
back="back.jpg"
sample="sample.jpg"
divW=$(( "$width" / 100 ))
divH=$(( "$height" / 100 ))
cp "$1" "$back"
for (( i=0; i<=$divW; i++ )); {
for (( j=0; j<=$divH; j++ )); {
magick "$back" \( +clone -crop 100x100+0+0 \) -geometry +$(( i * 100 ))+$(( j * 100 )) -composite "$back"
}
}