  We introduce a pipeline that performs rapid image subtraction and source
selection to detect transients, with a focus on identifying gravitational wave
optical counterparts using the Dark Energy Camera (DECam). In this work, we
present the pipeline steps from processing raw data to identification of
astrophysical transients on individual exposures. We process DECam data and
build difference images using the Vera C. Rubin Observatory Legacy Survey of
Space and Time (LSST) Science Pipelines software, and we use flags and
principal component analysis to select transients on a per-exposure basis,
without associating the results from different exposures. Those candidates will
be sent to brokers for further classification and alert distribution. We
validate our pipeline using archival exposures that cover various types of
objects, and the tested targets include a kilonova (GW170817), supernovae,
stellar flares, variable stars (in a resolved galaxy or the Milky Way Bulge),
and serendipitous objects. Overall, the data processing produces clean light
curves that are comparable with published results, demonstrating the
photometric quality of our pipeline. Real transients can be well selected by
our pipeline when sufficiently bright (S/N $\gtrsim15$). This pipeline is
intended to serve as a tool for the broader research community. Although this
pipeline is designed for DECam, our method can be easily applied to other
instruments and future LSST observations.
