Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
ppmshadow(1)
Edit
PageHistory
Diff
Info
LikePages
ppmshadow !!!ppmshadow NAME SYNOPSIS DESCRIPTION OPTIONS FILES LIMITATIONS EXIT STATUS SEE ALSO AUTHOR COPYRIGHT ---- !!NAME ppmshadow - add simulated shadows to a portable pixmap image !!SYNOPSIS __ppmshadow__ [[__-b__ ''blur_size''] [[__-k__] [[__-t__] [[__-x__ ''xoffset''] [[__-y__ ''yoffset''] [[__-u__] [[''pnmfile''] !!DESCRIPTION __ppmshadow__ adds a simulated shadow to an image, giving the appearance that the contents of the image float above the page, casting a diffuse shadow on the background. Shadows can either be black, as cast by opaque objects, or translucent, where the shadow takes on the colour of the object which casts it. You can specify the extent of the shadow and its displacement from the image with command line options. !!OPTIONS __-b__ ''blur_size'' Sets the distance of the light source from the image. Larger values move the light source closer, casting a more diffuse shadow, while smaller settings move the light further away, yielding a sharper shadow. ''blur_size'' defaults to 11 pixels. __-k__ Keep the intermediate temporary image files. When debugging, these intermediate files provide many clues as to the source of an error. See __FILES__ below for a list of the contents of each file. __-t__ Consider the non-background material in the image translucent -- it casts shadows of its own colour rather than a black shadow, which is default. This often results in fuzzy, difficult-to-read images but in some circumstances may look better. __-u__ Print command syntax and a summary of options. __-x__ ''xoffset'' Specifies the displacement of the light source to the left of the image. Larger settings of __xoffset__ displace the shadow to the right, as would be cast by a light further to the left. If not specified, the horizontal offset is half of ''blur_size'' (above), to the left. __-y__ ''yoffset'' Specifies the displacement of the light source above the top of the image. Larger settings displace the shadow downward, corresponding to moving the light further above the top of the image. If you don't specify __-y__, the vertical offset defaults to the same as the horizontal offset (above), upward. !!FILES Input is an anymap named by the ''pnmfile'' command line argument; if you don't specify ''pnmfile'', the input is the Standard Input file. Output is a always a PPM file, written to Standard Output. __pnmfile__ creates a number of temporary files as it executes. It creates them in the /tmp directory, with names of the form: ___PPMshadow__''pid''__-__''N''__.ppm__ where ''pid'' is the process number of the __ppmshadow__ process and ''N'' is a number identifying the file as described below. In normal operation, __ppmshadow__ deletes temporary files as soon as it is done with them and leaves no debris around after it completes. To preserve the intermediate files for debugging, use the __-k__ command line option. ''N'' in the filename means: __1__ Positive binary mask __2__ Convolution kernel for blurring shadow __3__ Blurred shadow image __4__ Clipped shadow image, offset as requested __5__ Blank image with background of source image __6__ Offset shadow __7__ Inverse mask file __8__ Original image times inverse mask __9__ Generated shadow times positive mask __10__ Shadow times background colour !!LIMITATIONS The source image must contain sufficient space on the edges in the direction in which the shadow is cast to contain the shadow -- if it doesn't some of the internal steps may fail. You can usually expand the border of a too-tightly-cropped image with __pnmmargin__ before processing it with __ppmshadow__. Black pixels and pixels with the same color as the image background don't cast a shadow. If this causes unintentional The background color of the source image (which is preserved in the output) is deemed to be the color of the pixel at the top left of the input image. 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 Netpbm programs __ppmshadow__ calls will, in general, provide little or no clue as to where __ppmshadow__ went astray. In this case, Specify the __-k__ option and examine the intermediate results in the temporary files (which this option causes to be preserved). If you manually run the commands that __ppmshadow__ runs on these files, you can figure out where the problem is. 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 __ppmshadow__. See the __ppmshadow.doc__ 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. Because Netpbm used to have a maximum maxval of 255, which meant that the largest convolution kernel __pnmconvol__ could use was 11 by 11, __ppmshadow__ includes a horrid, CPU-time-burning kludge which, if a blur of greater than 11 is requested, performs an initial convolution with an 11__pnmsmooth__ (which is actually a script that calls pnmconvol with a 3 __ 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. !!EXIT STATUS __ppmshadow__ returns status 0 if processing was completed without errors, and a nonzero Unix error code if an error prevented generation of output. Some errors may result in the script aborting, usually displaying error messages from various Netpbm components it uses, without returning a nonzero error code. When this happens, the output file will be empty, so be sure to test this if you need to know if the program succeeded. !!SEE ALSO pnm(5), pnmmargin(1), pnmconvol(1), pnmscale(1), pnmsmooth(1), ppm(5) !!AUTHOR John Walker !!COPYRIGHT This software is in the public domain. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, without any conditions or restrictions. ----
One page links to
ppmshadow(1)
:
Man1p
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.