# Subtract one image from another

**URL:** <https://boards.straightdope.com/t/subtract-one-image-from-another/644357>\
**Category:** Factual Questions\
**Created:** [December 17, 2012, 9:39pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357 "2012-12-17T21:39:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![UncleRojelio](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unclerojelio/32/3160_2.png) [@UncleRojelio](https://boards.straightdope.com/u/UncleRojelio)\
**Post date:** [December 17, 2012, 9:39pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/1 "2012-12-17T21:39:46Z")

</div>

I’m looking for an online method of subtracting one jpeg image from another. Anyone have any suggestions?

---

<div class="post-metadata">

**Author:** ![Telemark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/telemark/32/372_2.png) [@Telemark](https://boards.straightdope.com/u/Telemark)\
**Post date:** [December 17, 2012, 9:49pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/2 "2012-12-17T21:49:11Z")

</div>

> [@UncleRojelio](#):
>
> I’m looking for an online method of subtracting one jpeg image from another. Anyone have any suggestions?

Can you give an example of what you are looking for exactly? Your problem statement can be interpreted a few different ways.

---

<div class="post-metadata">

**Author:** ![Absolute](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Absolute](https://boards.straightdope.com/u/Absolute)\
**Post date:** [December 17, 2012, 10:32pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/3 "2012-12-17T22:32:22Z")

</div>

Unless there is a web-based tool someone has built for this exact purpose, I don’t think you’ll be able to do this.

Mathematica has a free trial and will make it a cinch, regardless of what you specifically want to do. Unfortunately, it is not web-based.

> **[Wolfram Library Archive--Resources and References for Mathematica and
Other...](https://library.wolfram.com/)**
>
> Wolfram Library Archive has thousands 
> of downloadable resources for Mathematica and other Wolfram products, 
> collected over the full history of Wolfram Research

---

<div class="post-metadata">

**Author:** ![UncleRojelio](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unclerojelio/32/3160_2.png) [@UncleRojelio](https://boards.straightdope.com/u/UncleRojelio)\
**Post date:** [December 18, 2012, 12:35am UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/4 "2012-12-18T00:35:44Z")

</div>

> [@Telemark](#):
>
> Can you give an example of what you are looking for exactly? Your problem statement can be interpreted a few different ways.

I think the solution to a puzzle is hidden in an image and in order to see the solution, I need to see the difference between two, seemingly, identical images.

---

<div class="post-metadata">

**Author:** ![Tinker\_Grey](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tinker_grey/32/8136_2.png) [@Tinker\_Grey](https://boards.straightdope.com/u/Tinker_Grey)\
**Post date:** [December 18, 2012, 1:01am UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/5 "2012-12-18T01:01:14Z")

</div>

Convert to raw. Subtract R from R, G from G, B from B. Convert back to JPEG.

Ghostview might do it.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [December 18, 2012, 1:33am UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/6 "2012-12-18T01:33:03Z")

</div>

Well, in Photoshop you can layer the images and use “difference” blending mode.

---

<div class="post-metadata">

**Author:** ![cmyk](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cmyk/32/3353_2.png) [@cmyk](https://boards.straightdope.com/u/cmyk)\
**Post date:** [December 18, 2012, 1:14pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/7 "2012-12-18T13:14:07Z")

</div>

> [@pulykamell](#):
>
> Well, in Photoshop you can layer the images and use “difference” blending mode.

This.

It’ll blend the two images together, one as a photo-positive, one as a photo-negative, and wherever the values are opposites, it’ll cancel the color out to a neutral gray. If there are differences in pixel values, those will become manifest in color depending on their differences.

---

<div class="post-metadata">

**Author:** ![furdmort](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@furdmort](https://boards.straightdope.com/u/furdmort)\
**Post date:** [December 18, 2012, 1:26pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/8 "2012-12-18T13:26:13Z")

</div>

The GIMP can do the Difference bblending mode on layers as well, and it is free. Not everyone has a copy of Photoshop floating around.

---

<div class="post-metadata">

**Author:** ![cmyk](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cmyk/32/3353_2.png) [@cmyk](https://boards.straightdope.com/u/cmyk)\
**Post date:** [December 18, 2012, 1:30pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/9 "2012-12-18T13:30:14Z")

</div>

My mistake, it’ll actually render any identical pixels black.

Here’s a nice [video demonstrating some of the blend modes,](http://www.digitalartform.com/archives/2009/06/subtractive_col_2.html) including Multiply and Exclusion.

There are other similar blending mode options within this group in newer versions of PS, such as Subtract and Divide.

---

<div class="post-metadata">

**Author:** ![panache45](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/panache45/32/64_2.png) [@panache45](https://boards.straightdope.com/u/panache45)\
**Post date:** [December 19, 2012, 12:54am UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/10 "2012-12-19T00:54:23Z")

</div>

> [@furdmort](#):
>
> Not everyone has a copy of Photoshop floating around.

Considering what I paid for it, mine is bolted down.

---

<div class="post-metadata">

**Author:** ![Joey\_P](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Joey\_P](https://boards.straightdope.com/u/Joey_P)\
**Post date:** [December 19, 2012, 1:33am UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/11 "2012-12-19T01:33:27Z")

</div>

Photoshop can do it so I assume Gimp can do it as well. I’ve never used Gimp and I understand there’s a bit of a learning curve, but if you’re willing to download it and give it a shot, it might be the way to go.

BTW, Gimp is essentially a free version of Photoshop. My understanding is that it can do most things that Photoshop can do, but it’s a bit clumsier and harder to learn (and there aren’t many tutorials). But since all you need to do is blend two layers, I can’t imagine it’s going to be that difficult. That’s pretty basic stuff when it comes to layers. Working with layers is really the heart of Photoshop and I assume it’s the same for Gimp.

---

<div class="post-metadata">

**Author:** ![cmyk](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cmyk/32/3353_2.png) [@cmyk](https://boards.straightdope.com/u/cmyk)\
**Post date:** [December 19, 2012, 1:33am UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/12 "2012-12-19T01:33:56Z")

</div>

After almost 20 years of paying upgrades, I should be on Adobe’s board of directors or something.

---

<div class="post-metadata">

**Author:** ![UncleRojelio](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unclerojelio/32/3160_2.png) [@UncleRojelio](https://boards.straightdope.com/u/UncleRojelio)\
**Post date:** [December 19, 2012, 4:04pm UTC](https://boards.straightdope.com/t/subtract-one-image-from-another/644357/13 "2012-12-19T16:04:27Z")

</div>

Thanks all for the help. Puzzle solved.
