Welcome to the Soartex forums!

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Welcome to the Soartex Forums! Consider signing up to get involved!

Tutorial Extracting images from a background

Discussion in 'Tutorials' started by Floppygunk, Jul 12, 2012.

  1. Floppygunk

    Floppygunk Cereal Killer

    Hello, peoples. I recently came across a good use for the 'difference' color filter, namely extracting watermarked/overlaid images with transparency from a background. It only extracts things with a single color, but it can be useful at times.

    So, let's say that one day you stumble across an image that looks like this:
    [​IMG]
    Gosh, that's a lovely 'A' logo! I think I'd like to stick it onto a green square.
    But wait! How do I take it off the circle with a subtle red gradient?

    To do this, you need a version of the background without the logo. With an image as simple as this, you may be able to recreate the background. Here the two layers are conveniently labeled 'background' and 'logo'.

    [​IMG]

    Now, with the 'logo' layer on top, set the blending mode to 'difference'.

    [​IMG]

    You now have a cyan 'A' in a black circle.
    [​IMG]
    To make the layer look that way without the blending mode, merge down the 'logo' layer onto the background 'layer' (you may want to duplicate the layers first if you want to keep them). Rename the 'background' layer 'logo'.

    [​IMG]

    Next, desaturate the logo (Image->Adjustments->Desaturate). Set the blend mode to 'screen'. You can now put it on your green square! You can adjust the brightness (Image->Adjustments->Brightness/Contrast...) to make the logo more visible.
    [​IMG]
    To make the logo black, invert the image (Image->Adjustments->Invert) and change the blend mode to 'multiply'.

    So, how is this useful?
    If you want to make a new health bar but keep the thing inside the hardcore hearts, you can extract it.
    I used this technique with the IC textures to get the sticky resin image from the tree to use as an item. I used the resulting white resin-shaped image as a mask, to get just the resin part.

    [​IMG]

    And that concludes my tutorial. Have fun! ;)
  2. Rashed

    Rashed Administrator

    Floppy, You Are Amazing. Using this ATM to make myself a nice "R" :p
  3. Floppygunk

    Floppygunk Cereal Killer

    Unfortunately that logo had both black and white in it, so the resulting image is of significantly lower quality...
    I'm sure there is a way to get both colors! I WILL find it!

    Edit: I found it!
    I'll put the tutorial on it up soon, but for now I'll give you the short version:

    I1=(I3-(b*I2))/(255-b)

    I1 is the icon you are extracting, I2 is the background image, and I3 is the original image, with both background and icon. '-' means use the difference filter, '/' means use the divide filter and '*' means use the multiply filter. (put the image on the right of the operation a layer above the one on the left). 'b' is a single color that you have to find the right value to use, and '255-b' is its inverse.

    If you think you followed that, good luck! Otherwise, just wait for my tutorial ;)
  4. Ninten_Droid

    Ninten_Droid Super Omega Ultra Member

    Hey, nice tutorial. I'll have to read this through if I want to make myself a cool logo ;P
  5. Floppygunk

    Floppygunk Cereal Killer

    Well, more like steal yourself a good logo :p

Share This Page