#!/bin/bash # # Generate a test image for IM examples. # # The Image contains fully-transparent, half-transparent and fully-opaque # reagions of the a full greyscale (black to white). It also contains regions # of pure black, white, and other colors, so as to give IM a good workout when # used in testing canvas and color modifications. # # This could actually be done all in one operation, but for debugging I like # to be able to see the intermediate images. # #### # # Anthony Thyssen Feburary 2004 # Draw fancy horizontal gradient... # magick -size 100x25 xc:white -size 100x100 gradient: -size 100x25 xc:black \ # -append -rotate 90 -blur 0x5 +repage test_gradient.png magick -size 100x150 gradient: -rotate 90 \ -sigmoidal-contrast 7x50% test_gradient.png # Create a semi-transparent rectangle of the gradient and flop it left-right magick -size 150x100 xc:black \ -draw 'fill grey50 rectangle 8,8 142,92' +matte \ test_gradient.png +swap -compose CopyOpacity -composite \ -flop ${png_format}test_bgnd.png # Draw two overlaping circles and fill then with same (non-flopped) gradient. magick -size 150x100 xc:black \ -draw 'fill white circle 40,50 40,12' \ -draw 'fill white circle 110,50 110,12' +matte \ test_gradient.png +swap -compose CopyOpacity -composite \ test_fgnd.png # Create a rainbow gradient magick -size 12x100 xc:Lime -colorspace HSB \ gradient:gray66 -compose CopyRed -composite \ -colorspace sRGB -rotate 90 -compose Over \ -bordercolor black -border 0x1 test_hue.png # Overlay the images and add some extra colors to result. # -draw 'fill green rectangle 40,64 110,96' \ magick test_bgnd.png test_fgnd.png -composite \ -draw 'fill red circle 25,80 25,98' \ -draw 'fill green circle 75,80 75,98' \ -draw 'fill blue circle 125,80 125,98' \ test_hue.png -geometry +25+80 -composite \ test.png # Remove the intermediate images (comment if debugging) rm -f test_gradient.png test_bgnd.png test_fgnd.png test_hue.png # Overlay on the pages background color to generate a JPEG # For stupid IE web clients that do not understand PNG transparency #magick test.png \ # \( +clone -fill "$page_bg_color" -draw 'color 0,0 reset' \) \ # -compose Dst_Over -composite $jpg_opt test.jpg # set permissions chmod 644 test.png