# Background and Foreground extraction in image

**URL:** <https://discuss.python.org/t/background-and-foreground-extraction-in-image/4896>\
**Category:** Python Help\
**Created:** [August 3, 2020, 10:19am UTC](https://discuss.python.org/t/background-and-foreground-extraction-in-image/4896 "2020-08-03T10:19:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preeti](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@Preeti](https://discuss.python.org/u/Preeti)\
**Post date:** [August 3, 2020, 10:19am UTC](https://discuss.python.org/t/background-and-foreground-extraction-in-image/4896/1 "2020-08-03T10:19:58Z")

</div>

Hi all,

I’m in need of extracting background and foreground colours in image. I tried with adrian’s OpenCV GrabCut: Foreground Segmentation and Extraction but this gives only foreground features. Please can you suggest me any library to extract the foreground and background colours.

Thanks in advance!!!
