Search code examples
imagemagickimagemagick-convert

How to create text effect like copyright protected image in shutterstock.com using Imagemagick?


While searching google, we see a lot of images with a text overlay effect that claim these images are coming from shutterstock.com.

This text effect is something like the following:

https://thumb7.shutterstock.com/display_pic_with_logo/4187557/559982074/stock-vector-few-little-houses-in-the-winter-forest-landscape-flat-style-vector-seamless-pattern-559982074.jpg

I am wondering how can I use ImageMagick cli to do something similar?

Thank you very much for any help.


Solution

  • Hi fmw42, thank you :) How can I add a big X like shutterstock.com?

    Draw two diagonal lines between the corners.

    Input (tile_aqua_500.jpg) :

    enter image description here

    In Imagemagick 6 Unix system:

    infile="tile_aqua_500.jpg"
    ww=$(convert -ping "$infile" -format "%[fx:w-1]" info:)
    hh=$(convert -ping "$infile" -format "%[fx:h-1]" info:)
    convert "$infile" \
    -fill "graya(100%,0.75)" \
    -draw "line 0,0 $ww,$hh line $ww,0 0,$hh" -alpha off \
    -fill "graya(50%,0.25)" \
    -strokewidth 1 -stroke "graya(100%,0.25)" \
    -gravity center -font arial -pointsize 48 \
    -annotate +0+0 "Hello World" tile_aqua_500_text_x.jpg
    

    In Imagemagick 7 Unix system:

    infile="tile_aqua_500.jpg"
    magick "$infile" \
    -fill "graya(100%,0.75)" \
    -draw "line 0,0 %[fx:w-1],%[fx:h-1] line %[fx:w-1],0 0,%[fx:h-1]" -alpha off \
    -fill "graya(50%,0.25)" \
    -strokewidth 1 -stroke "graya(100%,0.25)" \
    -gravity center -font arial -pointsize 48 \
    -annotate +0+0 "Hello World" tile_aqua_500_text_x.jpg
    

    Result of either command:

    enter image description here