Gimp-Forum.net
Removing White Pixels from Grayscale - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Removing White Pixels from Grayscale (/Thread-Removing-White-Pixels-from-Grayscale)

Pages: 1 2


Removing White Pixels from Grayscale - pongiste - 02-03-2018

I have used Gimp a bit in the past but have decided to adopt it as my main image editing software.

One of my most frequently performed tasks in Photoshop is removing the white background from pure black-and-white grayscales by dragging the gray channel onto the dotted circle option in the channel menu (sorry, away from my laptop at the moment so can't be more precise) which selects all the white pixels allowing me to delete the white pixels in one fell swoop.

Is there an equivalent workflow in Gimp? Thanks!


RE: Removing White Pixels from Grayscale - rich2005 - 02-03-2018

Maybe Gimp menu: Color -> Color-to-alpha
see: https://docs.gimp.org/en/plug-in-colortoalpha.html

White is the default to remove

edit: If the menu entry is greyed out your black/white image is in indexed/grey mode. Change to RGB Gimp menu: Image -> Mode -> RGB

sorry, I have absolutely no idea what PS..dotted circle option in the channel menu is

another edit: Since you are using a Mac and Gimp help might not be installed a useful resource is the Gimp help in PDF format see: http://gimp.linux.it/www/meta/


RE: Removing White Pixels from Grayscale - Ofnuts - 02-03-2018

(02-03-2018, 07:19 PM)pongiste Wrote: I have used Gimp a bit in the past but have decided to adopt it as my main image editing software.

One of my most frequently performed tasks in Photoshop is removing the white background from pure black-and-white grayscales by dragging the gray channel onto the dotted circle option in the channel menu (sorry, away from my laptop at the moment so can't be more precise) which selects all the white pixels allowing me to delete the white pixels in one fell swoop.

Is there an equivalent workflow in Gimp? Thanks!

To select all the white pixels, use the color selector ( SelectByColor ) and click on any white pixel.

But as Rich says, Color-to-alpha may give better results.


RE: Removing White Pixels from Grayscale - Espermaschine - 02-04-2018

rich2005 Wrote:sorry, I have absolutely no idea what PS..dotted circle option in the channel menu is

load selection from channel


(02-03-2018, 08:33 PM)Ofnuts Wrote: But as Rich says, Color-to-alpha may give better results.

ofn-erase-background !!


RE: Removing White Pixels from Grayscale - Ofnuts - 02-04-2018

(02-04-2018, 03:21 AM)Espermaschine Wrote:
rich2005 Wrote:sorry, I have absolutely no idea what PS..dotted circle option in the channel menu is

load selection from channel
Then it's Open Layer list>Right click channel>Channel to selection

(02-04-2018, 03:21 AM)Espermaschine Wrote:
(02-03-2018, 08:33 PM)Ofnuts Wrote: But as Rich says, Color-to-alpha may give better results.

ofn-erase-background !!
Possibly, but the problem hasn't been exposed as a high-level goal...


RE: Removing White Pixels from Grayscale - Espermaschine - 02-04-2018

(02-04-2018, 07:27 AM)Ofnuts Wrote:
(02-04-2018, 03:21 AM)Espermaschine Wrote: ofn-erase-background !!

Possibly, but the problem hasn't been exposed as a high-level goal...

Well the PS routine leaves the semi transparent pixels as a white-ish halo and OP is trying to get rid of the background.
So your script is the best tool for the job.



P.S: what is a high level-goal ?


RE: Removing White Pixels from Grayscale - Ofnuts - 02-04-2018

High level (aka "X"): I want to remove the background
Low level (aka "Y"): I want to select the white pixels to delete them

See https://meta.stackexchange.com/a/66378/329457


RE: Removing White Pixels from Grayscale - rich2005 - 02-04-2018

Another day, another way. Without having to go out of greyscale. Maybe this is PS equivalent.

Copy-paste-anchor an image copy into a layer mask.
Colour -> Invert the layermask.

[Image: yytUeVU.jpg]


RE: Removing White Pixels from Grayscale - Espermaschine - 02-04-2018

(02-04-2018, 08:16 AM)Ofnuts Wrote: See https://meta.stackexchange.com/a/66378/329457

That is some level 30 wizard stuff in a world full of 5 XP apprentices XD


RE: Removing White Pixels from Grayscale - Ofnuts - 02-04-2018

(02-04-2018, 08:31 AM)rich2005 Wrote: Another day, another way. Without having to go out of greyscale. Maybe this is PS equivalent.

Copy-paste-anchor an image copy into a layer mask.
Colour -> Invert the layermask.

Much simpler to do Layer>Add layer mask, and tick "Init with grayscale copy of layer", and "invert mask".