Since the comparison is exact, the modified areas will now cast shadows. If that pixel isn't part of the background, simply add a one-pixel border at the top of the image, generate the shadow image, then delete the border from it. If something goes wrong along the way, the error messages from the various PBMplus components will, in general, provide little or no clue as to where pnmshadow went astray. In problem cases where you want to manually tweak the image generation process along the way, you can keep the intermediate files with the -k option, modify them appropriately with an image editor, then recombine them with the steps used by the code in this script. How it Works document for additional details and examples of the intermediate files.
Shadows are by default black, as cast by opaque material in the image occluding white light.
Use the -t option to simulate translucent material, where the shadow takes on the colour of the object that casts it. If the contrast between the image and background is insufficient, the -t option may yield unattractive results which resemble simple blurring of the original image. It's ugly, but it gets the job done on those rare occasions where you need a blur greater than 11. If you wish to generate an image at high resolution, then scale it to publication size with pnmscale in order to eliminate jagged edges by resampling, it's best to generate the shadow in the original high resolution image, prior to scaling it down in size. If you scale first and then add the shadow, you'll get an unsightly jagged stripe between the edge of material and its shadow, due to resampled pixels intermediate between the image and background obscuring the shadow.