# Image subtraction

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Image_subtraction
> Markdown URL: https://mediated.wiki/source/Image_subtraction.md
> Source: https://en.wikipedia.org/wiki/Image_subtraction
> Source revision: 1279300272
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Digital image manipulation technique

**Image subtraction** or **pixel subtraction** or **difference imaging** is an [image processing](/source/Image_processing) technique whereby the digital numeric value of one pixel or whole image is subtracted from another image, and a new image generated from the result. This is primarily done for one of two reasons – levelling uneven sections of an image such as half an image having a shadow on it, or detecting changes between two images.[1] This method can show things in the image that have changed position, brightness, color, or shape.

For this technique to work, the two images must first be spatially aligned to match features between them, and their [photometric](/source/Photometry_(optics)) values and [point spread functions](/source/Point_spread_function) must be made compatible, either by careful calibration, or by post-processing (using [color mapping](/source/Color_mapping)). The complexity of the pre-processing needed before differencing varies with the type of image, but is essential to ensure good subtraction of static features.

This is commonly used in fields such as [time-domain astronomy](/source/Time-domain_astronomy) (known primarily as **difference imaging**) to find objects that fluctuate in brightness or move. In automated searches for [asteroids](/source/Asteroid#Computerized_methods) or [Kuiper belt objects](/source/Kuiper_belt), the target moves and will be in one place in one image, and in another place in a reference image made an hour or day later. Thus, [image processing](/source/Image_processing) algorithms can make the fixed stars in the background disappear, leaving only the target.[2] Distinct families of astronomical image subtraction techniques have emerged, operating in both image space[3][4] or frequency space,[5][6] with distinct trade-offs in both quality of subtraction and computational cost. These algorithms lie at the heart of almost all modern (and upcoming) [transient](https://en.wikipedia.org/w/index.php?title=Astrophysical_transient&action=edit&redlink=1) [surveys](/source/Astronomical_survey),[7][8] and can enable the detection of even faint [supernovae](/source/Supernova) embedded in bright [galaxies](/source/Galaxy). Nevertheless, in astronomical imaging, significant 'residuals' remain around bright, complex sources, necessitating further algorithmic steps to identify candidates (known as [real-bogus classification](https://en.wikipedia.org/w/index.php?title=Real-bogus_classification&action=edit&redlink=1))

The [Hutchinson metric](/source/Hutchinson_metric) can be used to "measure of the discrepancy between two [images](/source/Image) for use in [fractal](/source/Fractal) [image processing](/source/Image_processing)".[9][10]

## See also

- [Blink comparator](/source/Blink_comparator)

- [Difference matte](https://en.wikipedia.org/w/index.php?title=Difference_matte&action=edit&redlink=1)

- [Image stabilization](/source/Image_stabilization)

- [Dark frame subtraction](/source/Dark_frame_subtraction) – where a neutral "blank" frame is subtracted to reduce noise

- [Palomar Transient Factory](/source/Palomar_Transient_Factory) – a wide-field survey that uses image subtraction

## References

1. **[^](#cite_ref-1)** [HIPR2 homepage at The University of Edinburgh School of Informatics](http://homepages.inf.ed.ac.uk/rbf/HIPR2/pixsub.htm)

1. **[^](#cite_ref-2)** [Image Subtraction Procedure for Faint Asteroids by Bruce Gary](http://brucegary.net/A86279/ISfor6128.html)

1. **[^](#cite_ref-3)** Alard, C.; Lupton, R. H. (1998-08-10). "A method for optimal image subtraction". *The Astrophysical Journal*. **503** (1): 325–331. [arXiv](/source/ArXiv_(identifier)):[astro-ph/9712287](https://arxiv.org/abs/astro-ph/9712287). [Bibcode](/source/Bibcode_(identifier)):[1998ApJ...503..325A](https://ui.adsabs.harvard.edu/abs/1998ApJ...503..325A). [doi](/source/Doi_(identifier)):[10.1086/305984](https://doi.org/10.1086%2F305984). [ISSN](/source/ISSN_(identifier)) [0004-637X](https://search.worldcat.org/issn/0004-637X). [S2CID](/source/S2CID_(identifier)) [15582577](https://api.semanticscholar.org/CorpusID:15582577).

1. **[^](#cite_ref-4)** Bramich, D. M. (May 2008). ["A New Algorithm For Difference Image Analysis"](https://doi.org/10.1111%2Fj.1745-3933.2008.00464.x). *Monthly Notices of the Royal Astronomical Society: Letters*. **386** (1): L77–L81. [arXiv](/source/ArXiv_(identifier)):[0802.1273](https://arxiv.org/abs/0802.1273). [Bibcode](/source/Bibcode_(identifier)):[2008MNRAS.386L..77B](https://ui.adsabs.harvard.edu/abs/2008MNRAS.386L..77B). [doi](/source/Doi_(identifier)):[10.1111/j.1745-3933.2008.00464.x](https://doi.org/10.1111%2Fj.1745-3933.2008.00464.x). [ISSN](/source/ISSN_(identifier)) [1745-3925](https://search.worldcat.org/issn/1745-3925). [S2CID](/source/S2CID_(identifier)) [14178876](https://api.semanticscholar.org/CorpusID:14178876).

1. **[^](#cite_ref-5)** Zackay, Barak; Ofek, Eran O.; Gal-Yam, Avishay (2016-10-04). ["Proper image subtraction - optimal transient detection, photometry and hypothesis testing"](https://doi.org/10.3847%2F0004-637X%2F830%2F1%2F27). *The Astrophysical Journal*. **830** (1): 27. [arXiv](/source/ArXiv_(identifier)):[1601.02655](https://arxiv.org/abs/1601.02655). [Bibcode](/source/Bibcode_(identifier)):[2016ApJ...830...27Z](https://ui.adsabs.harvard.edu/abs/2016ApJ...830...27Z). [doi](/source/Doi_(identifier)):[10.3847/0004-637X/830/1/27](https://doi.org/10.3847%2F0004-637X%2F830%2F1%2F27). [ISSN](/source/ISSN_(identifier)) [1538-4357](https://search.worldcat.org/issn/1538-4357).

1. **[^](#cite_ref-6)** Hu, Lei; Wang, Lifan; Chen, Xingzhuo; Yang, Jiawen (2022-09-01). ["Image Subtraction in Fourier Space"](https://doi.org/10.3847%2F1538-4357%2Fac7394). *The Astrophysical Journal*. **936** (2): 157. [arXiv](/source/ArXiv_(identifier)):[2109.09334](https://arxiv.org/abs/2109.09334). [Bibcode](/source/Bibcode_(identifier)):[2022ApJ...936..157H](https://ui.adsabs.harvard.edu/abs/2022ApJ...936..157H). [doi](/source/Doi_(identifier)):[10.3847/1538-4357/ac7394](https://doi.org/10.3847%2F1538-4357%2Fac7394). [ISSN](/source/ISSN_(identifier)) [0004-637X](https://search.worldcat.org/issn/0004-637X).

1. **[^](#cite_ref-7)** Kessler, R.; Marriner, J.; Childress, M.; Covarrubias, R.; D’Andrea, C. B.; Finley, D. A.; Fischer, J.; Foley, R. J.; Goldstein, D.; Gupta, R. R.; Kuehn, K.; Marcha, M.; Nichol, R. C.; Papadopoulos, A.; Sako, M. (2015-11-06). ["The Difference Imaging Pipeline for the Transient Search in the Dark Energy Survey"](https://iopscience.iop.org/article/10.1088/0004-6256/150/6/172). *The Astronomical Journal*. **150** (6): 172. [arXiv](/source/ArXiv_(identifier)):[1507.05137](https://arxiv.org/abs/1507.05137). [Bibcode](/source/Bibcode_(identifier)):[2015AJ....150..172K](https://ui.adsabs.harvard.edu/abs/2015AJ....150..172K). [doi](/source/Doi_(identifier)):[10.1088/0004-6256/150/6/172](https://doi.org/10.1088%2F0004-6256%2F150%2F6%2F172). [ISSN](/source/ISSN_(identifier)) [1538-3881](https://search.worldcat.org/issn/1538-3881). [S2CID](/source/S2CID_(identifier)) [18310701](https://api.semanticscholar.org/CorpusID:18310701).

1. **[^](#cite_ref-8)** Masci, Frank J.; Laher, Russ R.; Rusholme, Ben; Shupe, David L.; Groom, Steven; Surace, Jason; Jackson, Edward; Monkewitz, Serge; Beck, Ron; Flynn, David; Terek, Scott; Landry, Walter; Hacopians, Eugean; Desai, Vandana; Howell, Justin (2018-12-07). ["The Zwicky Transient Facility: Data Processing, Products, and Archive"](https://doi.org/10.1088%2F1538-3873%2Faae8ac). *Publications of the Astronomical Society of the Pacific*. **131** (995): 018003. [arXiv](/source/ArXiv_(identifier)):[1902.01872](https://arxiv.org/abs/1902.01872). [doi](/source/Doi_(identifier)):[10.1088/1538-3873/aae8ac](https://doi.org/10.1088%2F1538-3873%2Faae8ac). [ISSN](/source/ISSN_(identifier)) [0004-6280](https://search.worldcat.org/issn/0004-6280). [S2CID](/source/S2CID_(identifier)) [119079815](https://api.semanticscholar.org/CorpusID:119079815).

1. **[^](#cite_ref-9)** [Efficient computation of the Hutchinson metric between digitized images](https://ieeexplore.ieee.org/document/1355938/;jsessionid=6AA1EBEC6173D62CD2311E2CBA6E8AA3?arnumber=1355938) abstract

1. **[^](#cite_ref-10)** [HUTCHINSON METRIC IN FRACTAL DNA ANALYSIS -- A NEURAL NETWORK APPROACH](http://isis.pub.ro/iafa2003/files/3-5.pdf) [Archived](https://web.archive.org/web/20110818165407/http://isis.pub.ro/iafa2003/files/3-5.pdf) August 18, 2011, at the [Wayback Machine](/source/Wayback_Machine)

## External links

- Sussex Computer Vision webpage: [Use of motion information in computer vision](http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/YOUNG/vision6.html)

This technology-related article is a stub. You can help Wikipedia by adding missing information.

- [v](https://en.wikipedia.org/wiki/Template:Tech-stub)
- [t](/source/Template_talk%3ATech-stub)
- [e](https://en.wikipedia.org/wiki/Special:EditPage/Template:Tech-stub)

This photography-related article is a stub. You can help Wikipedia by adding missing information.

- [v](https://en.wikipedia.org/wiki/Template:Photo-stub)
- [t](/source/Template_talk%3APhoto-stub)
- [e](https://en.wikipedia.org/wiki/Special:EditPage/Template:Photo-stub)

---
Adapted from the Wikipedia article [Image subtraction](https://en.wikipedia.org/wiki/Image_subtraction) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Image_subtraction?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
