I've a script to create '3D' product images. It takes an image, distorts it, then drops it onto a pre-prepared background containing the common sides and shadow of the product. All is good, and I end up with nice 3D product images on white backgrounds. Here's my script:
Code: Select all
convert source.tif -colorspace RGB -resize 277x350! -alpha on -virtual-pixel transparent -filter point \( +clone -flip -size 277x80 gradient:gray40-black -alpha off -compose CopyOpacity -composite \) -append +distort Perspective '0,0 37,44 0,277 37,213 277,350 199,280 350,0 259,18' -gravity North -crop 277x350+53-0\! -background transparent -compose Over -flatten background.png +swap -composite output.png
Is it possible to have the script amended to the following pseudo code:
if the pixel at coordinates 1,1 of source.tif is color #ffffff, add a 1px #cccccc border to the image before processing as normal.
Thanks in advance!