DEV Community

Cover image for Remove background from Image using CSS only

Remove background from Image using CSS only

jeetvora331 on May 18, 2023

In this beginner-friendly blog post, we will learn how to remove the background from an image using only CSS, specifically the mix-blend-mode prope...
Collapse
 
jonrandy profile image
Jon Randy 🎖️

Your cover image is pretty misleading, as is the title of the article. If you use multiply with that, you will go from this:

Normal blend

To this:

Mulitply

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

This value will remove the whiter parts of the image

Unfortunately, that is not what the multiply blend mode does at all

Collapse
 
jeetvora331 profile image
jeetvora331

Yes Jon, that is true. But the cover image was only for the abstraction or the idea to show what the blog is about. I need to add this because the title sometimes can be interpreted as "remove the background image with css only". I have noted your suggestion and will try to improve from my next post.

Thankyou for your feedback !

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

You could just replace the image in the banner for the one you used in the article, and add an explanation that it only works on black on white images.

Collapse
 
mackfitz profile image
Maciek Fitzner

To achieve the effect presented in the first image you could use mask-image, instead - with the boy's silhouette and the bulb in black, and the rest set to transparent.

Collapse
 
gourav_kumar_1 profile image
Gourav Kumar

superb

Collapse
 
roniardynt profile image
Ron

cool, i think i need more css tricks like this ✨

Collapse
 
dougsource profile image
doug-source

Would you allow me to publish your post translated into Brazilian Portuguese, here on DevTo 😉?

Collapse
 
kaushikantala profile image
kaushikantala • Edited

cool, i think i need more css tricks like this

Collapse
 
maxdzyubak profile image
Maxim Dzyubak

Thanks!

Collapse
 
aviral_singh_b5867718aba4 profile image
Aviral Singh

A