Jump to content
You must now use your email address to sign in [click for more info] ×

Removing white background


Recommended Posts

Hi There,

I am trying to figure out how to remove the white background from this design. From the forum, here, I learned to use the selection brush tool on the white but that just deletes the whole image. I tried inverting the selection but that also did not work. Any help would be much appreciated!  Thank you!!!

Screen Shot 2018-10-07 at 8.14.32 PM.png

Link to comment
Share on other sites

Initially I expected "Erase White Paper" to work here (found in the FIlters-->Colors menu, but Affinity Photo's won't leave the saturation alone, which results in semi-transparent colour fills. Sigh. Half-baked implementation compared to other apps, unfortunately.

After applying the erase white paper effect, duplicate the layer four, five or seven times to restore the fills. Then merge those layers. (Merge visible).

Or use the flood select tool, turn off "Contiguous" and click on the white background. Then hit the delete key. But it will leave white fringes, and Affinity defringe function for some reason won't deal with them.

Link to comment
Share on other sites

I thought the Threshold Adjustment might help with this and had a go at doing this with your image.

 

1. Original image was 1130 X 724 with transparent strips at left and on top. These caused me problems during the following steps so I started again by removing these areas out of the image. Did this by Resize Canvas and then rasterizing. Result was 1114 X 702.

2. Duplicated the Background layer, renamed it Work for clarity.

3. Added a Threshold Adjustment to the Work layer, setting the Threshold value to 99%. The white areas remained white, everything else became black.

4. Dragged the Threshold Adjustment layer into the Work layer.

5. In Layers panel, selected the Work layer, then used the Flood Select Tool ("magic wand") to select the white areas on the layer. Used a Tolerance of 1 or 2 % and unticked Contiguous.

6. From the menu, Select -> Invert Pixel Selection. This selected everything except the white areas, i.e. the letters

7. In Layers panel, hid the Work layer, selected the Background layer and then Duplicated it. This creates\d a layer from the Background layer, but, because the selection was still in effect, only the coloured letters were in it, all else was transparent. I think this is what you were aiming for.

 

Modified 1084073777_ScreenShot2018-10-07.png

Link to comment
Share on other sites

I first added a grey background fill layer just so I could see the erase effect better, then used the Flood Select (magic wand) tool with Contiguous disabled on the pixel layer to select as much of the while as I could without selecting anything else, just like @Medical Officer Bones suggested. For me 39% tolerance worked well.

To include most of the remaining near-white anti-aliased edges in the selection, I just selected "Refine Edges..." from the Select menu, waited briefly for the default refinement to complete, clicked "Apply" & then tapped the delete key. This was the result:
954060779_Hoosbirthday.jpg.eaf35e8b93fb6256ef67f82e657d4a60.jpg

There is still a small amount of anti-alias edge fringing, which can be seen by varying the fill layer color, but for ~10 seconds of work, this gets pretty decent results.

Hoo's birthday.afphoto includes the history so you can step backwards & forwards to see how it was done.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

8 hours ago, Medical Officer Bones said:

Initially I expected "Erase White Paper" to work here (found in the FIlters-->Colors menu, but Affinity Photo's won't leave the saturation alone, which results in semi-transparent colour fills.

That is because despite what the Erase White Paper filter help topic implies about not affecting any other colors, it is really only intended for line art drawn on physical media like paper.

8 hours ago, Medical Officer Bones said:

... But it will leave white fringes, and Affinity defringe function for some reason won't deal with them.

That is because the Defringe filter is a specialized one intended to remove color fringing due to chromatic aberration in camera sensors. The Defringing and Chromatic Aberration video tutorial explains how to use it.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

Hi ac-13,
Welcome to Affinity Forums :)
One way to quickly remove the white here is using Blend Options - you can access them clicking the cog icon on the top right of the Layers panel. Set the left graph as shown on the screenshot below and you should get a clean result.

blend_options.jpg.10dd40af5e0a591e4ce66a676e7e1fbe.jpg

Link to comment
Share on other sites

12 minutes ago, MEB said:

One way to quickly remove the white here is using Blend Options - you can access them clicking the cog icon on the top right of the Layers panel. Set the left graph as shown on the screenshot below and you should get a clean result.

I think maybe I am doing something wrong when I try that because adding a background fill layer reveals a lot of edge effects that I cannot get rid of:
1378628667_blendedHoo.jpg.fb3ef97bee8c0f503f868d3891ab20d1.jpg

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

Hi @MEB Does this actually remove or just hide the white?

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

Yet another method for this image would be to trace it in a 3rdparty app because Affinity doesn't have a trace facility as of yet then remove any extraneous remnants.

So this is what I end up with using this method.

933638398_ScreenShot.png.4f240e1c57b18e0e50d8350ef1ccaf79.png

hoos havin a birthday.afdesign

A much cleaner "cut", It would look even better with a better resolution image instead of using the image uploaded.

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

1 hour ago, MEB said:

Technically it hides. If you want to remove it definitely go to Document ▸ Flatten (make sure Transparent Background it ticked)or right-click the layer and select Merge Visible to create a transparent version (copy) of the layer.

When I try either of those things, if I add a background fill layer, I see the same white edge effects as in my previous post -- the pixel layer is not a clean copy free of white outlines. Hoo's B-day with merge.afphoto

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

2 hours ago, R C-R said:

When I try either of those things, if I add a background fill layer, I see the same white edge effects as in my previous post -- the pixel layer is not a clean copy free of white outlines. Hoo's B-day with merge.afphoto

If you do what Miguel says, then run Erase White Paper on the layer, it makes quite an improvement and gets rid of any lingering white bits (see below). I set the Blend Ranges back to normal afterwards.

But it would be better with a higher resolution image.

hoo.thumb.jpg.8f3239ede4b52d12de74e981eeecc9b4.jpg

hoofile.afphoto

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

44 minutes ago, toltec said:

If you do what Miguel says, then run Erase White Paper on the layer, it makes quite an improvement and gets rid of any lingering white bits (see below). I set the Blend Ranges back to normal afterwards.

If I use the Erase White Paper option after doing what Miguel suggested, there is a substantial saturation shift, like @Medical Officer Bones mentioned above, but there is also a decrease in opacity of almost all the non-black parts of the image. You can demonstrate this in your hoofile by selecting the pixel layer & from the Select menu use Alpha range > Select Partially Transparent.

EDIT: Alternately, just hide the fill layer in your hoofile.afphoto file & you can see part of the checkerboard transparency showing through the colored parts of the pixel layer:

1554694875_Hooscloseup.jpg.ff7dfe4e1f2a9339ce4c1db3d1ef0bc1.jpg

Edited by R C-R

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

44 minutes ago, R C-R said:

If I use the Erase White Paper option after doing what Miguel suggested, there is a substantial saturation shift, like @Medical Officer Bones mentioned above, but there is also a decrease in opacity of almost all the non-black parts of the image. You can demonstrate this in your hoofile by selecting the pixel layer & from the Select menu use Alpha range > Select Partially Transparent.

It's very easy to fix that. I was more concerned with the nasty white bits around the edges.

Use a Curves adjustment and adjust the Alpha range to repair the transparency issue, then adjust the Master range to bring the colour back.

hooalpha.thumb.jpg.921626e0b0a31a8cfc086aca89753448.jpg

hoocurve.afphoto

It might not even be necessary to adjust the blend ranges first. But I was quite interested in playing with them.

Edit. In fact it is not. Just use Erase White Paper then use Alpha (curves adjustment) to repair the opacity and adjust the Master range to tweak the colour.

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

14 hours ago, Medical Officer Bones said:

Initially I expected "Erase White Paper" to work here (found in the FIlters-->Colors menu, but Affinity Photo's won't leave the saturation alone, which results in semi-transparent colour fills. Sigh. Half-baked implementation compared to other apps, unfortunately.

You can repair that by using a Curves Adjustment and changing the Alpha. See post above.

alpha.jpg.a5fb49276a014c67d9016a808d8cddd7.jpg

p.s. Will need a slight tweak of the master range for the colour.

 

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

It doesn't look like anyone mentioned it yet, but that second O still needs a transparent area.

Also, R C-R, when I opened the file you attached, it looks like you had an additional layer. All I did to get Miguel's result was copied and pasted the original image and blended it by itself. Or is that already understood?

The website is still a work in progress. The "Comics" and "Shop" sections are not yet ready. Feel free to connect with me and let me know what you like or what can be improved. You can contact me here, on my contact page, YouTube channel, or Twitter account. Thanks and have a great day!

Link to comment
Share on other sites

36 minutes ago, toltec said:

You can repair that by using a Curves Adjustment and changing the Alpha. See post above.

To get all the blue to 100% opaque, I had to use a much steeper alpha curve adjustment than in your last example. Similarly, your Master range 'tweak' did not restore the HSL values of the colors to their original values. I suppose with a lot of trial & error it might. I did not try that because it would be extremely tedious to use the Info panel to target various color areas of the original, turn off the background Fill layer in the example, & try to target the same areas in that, & try to adjust the Master (or the individual RGB) ranges to get exact matches.

Basically, there was nothing easy about it, assuming the goal was an exact color match to the original. :(

51 minutes ago, Bri-Toon said:

It doesn't look like anyone mentioned it yet, but that second O still needs a transparent area.

Since the second O in the original had a filled in yellow center & is not part of the white background, I (& I think the others) assumed it was supposed to be preserved.

54 minutes ago, Bri-Toon said:

Also, R C-R, when I opened the file you attached, it looks like you had an additional layer. All I did to get Miguel's result was copied and pasted the original image and blended it by itself.

As I mentioned in my first reply, I added a Fill layer (which was moved to the bottom of the layer stack) to make it easy to see any white or off-white areas that might remain after trying the various techniques. I assume the others did something similar for the same reason.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

5 minutes ago, toltec said:

I honestly don't think it would matter that much to the OP or Hoo ;)

Maybe you are right about that for this particular file, but as a general technique for cleanly removing white backgrounds from raster image files without causing color shifts, neither MEB's method nor your enhanced version does that very well. Neither does the method I suggested, but at least it is very quick, minimizes edge fringing, & does not change the original colors.

From what I can tell, the only method that does it all is the one @firstdefence mentioned, but that requires using an external auto-trace method, & that means fiddling with the auto-trace settings or the nodes after conversion to get good fidelity to the original shapes without introducing extra jagged edges (like can be seen in the "i" in "Birthday" in his file).

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

14 minutes ago, R C-R said:

As I mentioned in my first reply, I added a Fill layer (which was moved to the bottom of the layer stack) to make it easy to see any white or off-white areas that might remain after trying the various techniques. I assume the others did something similar for the same reason.

I see. My mistake. I didn't realize you were continuing from your original answer.

The website is still a work in progress. The "Comics" and "Shop" sections are not yet ready. Feel free to connect with me and let me know what you like or what can be improved. You can contact me here, on my contact page, YouTube channel, or Twitter account. Thanks and have a great day!

Link to comment
Share on other sites

12 minutes ago, Bri-Toon said:

I didn't realize you were continuing from your original answer.

My assumption (which of course could be totally wrong) was that the only reason for removing the white background was so the image could be placed over something else without any visible white fringes or color or alpha shifts. So if that is true, testing with a Fill or some other background would be necessary to see how well any of the methods worked.

As it is, I am surprised that it isn't a lot easier to find a method that does all that quickly & easily.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

Good Fidelity really requires a good subject but I think this rings true for all of the above mentioned methods, the better the quality of the original image the better the end result.

iMac 27" 2019 Somona 14.3.1, iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

If Photo had a Document Setup like Designer, I would just say to set the background transparent from there. I'm assuming that's the program that is being used since Rachie didn't specify.

The website is still a work in progress. The "Comics" and "Shop" sections are not yet ready. Feel free to connect with me and let me know what you like or what can be improved. You can contact me here, on my contact page, YouTube channel, or Twitter account. Thanks and have a great day!

Link to comment
Share on other sites

2 hours ago, Bri-Toon said:

If Photo had a Document Setup like Designer, I would just say to set the background transparent from there. I'm assuming that's the program that is being used since Rachie didn't specify.

At least for the file in the first post, it is in PNG format & already has a transparent background when opened in either Affinity app, so the white is 'baked into' the raster image. Without the original to work with, there is no way to know why the white background is there.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.