1

I am looking for a python module that will allow me to import an image from my disk and do the following manipulations :-

  • Convert a black colour pixel to white.

  • Convert all othe colored pixels to white.

So as to obtain a pure black and white image. Since they are so many of modules related to image editing so I am unable to decide which one to use ?

Please Help.

  • PIL seems to be an obvious choice. Was there a particular problem when you tried to use it? – mkrieger1 Jun 16 '21 at 11:56
  • well seems that following your instructions of converting pixels, all pixels will be white meaning that it will be just a picture of white pixels. using PIL might work, there probably is a method to convert an image to bw – Matiiss Jun 16 '21 at 11:59
  • @mkrieger1 I have no idea of this module. – Mr. Anonymous Jun 16 '21 at 12:00
  • Okay. Then you can learn it. – mkrieger1 Jun 16 '21 at 12:01
  • Does this answer your question? [Using python PIL to turn a RGB image into a pure black and white image](https://stackoverflow.com/questions/9506841/using-python-pil-to-turn-a-rgb-image-into-a-pure-black-and-white-image) – Matiiss Jun 16 '21 at 12:01
  • @user933496 it is what You have tagged Yourself: Python Imaging Library - PIL – Matiiss Jun 16 '21 at 12:02
  • 1
    Don't install PIL. Install Pillow instead. It works the same, but is better maintained. – 9769953 Jun 16 '21 at 12:03
  • @9769953 actually that is literally the same exact thing, it is just that You can't `pip install PIL` because there is no such thing so to get PIL one needs to `pip install pillow` but still it is referenced PIL when importing – Matiiss Jun 16 '21 at 12:05
  • @Matiiss Thus, it's not the same thing: if one doesn't mention "install pillow" instead, the OP may be a long time searching how to install a 10+ year old PIL package. – 9769953 Jun 16 '21 at 12:09

0 Answers0