ImageMagick - replace all colors with white

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Locked
bodomalo
Posts: 6
Joined: 2016-08-15T10:32:47-07:00
Authentication code: 1151

ImageMagick - replace all colors with white

Post by bodomalo »

Hi

I need help with a CONVERT command
I would like to do the following:
Remove all images from a text-preview image (created from PDF)

My only idea so far is: "I remove all colors and replace them with white"
(I know, this will keep black and white images...but those are rare)
=
convert balloon.gif -fill white +opaque black balloon_borders.gif

But, this is too hard, as it also removes all grey-tones and the result looks like a simple black/white picture, without
any grey
What can I do, to remove anything beside grey-tones? (not 00000 black)

Or do you have any other idea how to "keep thiny text-structures, but remove all areas covered with blocks of colors...?"

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick - replace all colors with white

Post by snibgo »

What version of IM, on what platform? Please show your input image.

You could make a mask, eg from the C channel of HCL.
snibgo's IM pages: im.snibgo.com

bodomalo
Posts: 6
Joined: 2016-08-15T10:32:47-07:00
Authentication code: 1151

Re: ImageMagick - replace all colors with white

Post by bodomalo »

Plattform is ubuntu 15 , server installation
version is 7.0.2-9 Q16

A mask is made in two steps? And then?
can you show me a convert example?

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick - replace all colors with white

Post by snibgo »

Please show your input image.
snibgo's IM pages: im.snibgo.com

Locked