Set darkness threshold

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?".
Post Reply
pwhbeck

Set darkness threshold

Post by pwhbeck »

I am displaying text over a background jpg image. The jpg image is from a still webcam and changes several times a day. When text overlays a dark area of the image it is unreadable. Is there a way to make pixels of the image no darker than a threshold value? I use convert to lighten the image overall, but still have areas that are too dark.
Thanks,
Peter
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Set darkness threshold

Post by fmw42 »

convert image +level XXx100% result

where XX is some minimum graylevel value that you want black to become.

see http://www.imagemagick.org/Usage/color/#level_plus

You might post a link to one of your example images so others can test techniques and to understand your problem
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Set darkness threshold

Post by anthony »

This is a typical annotation problem.. Making text visible regardless of the background on which it appears.

The solution depends on youe background and if your text is a watermark or should be very boldly visible, and how pretty you want it.

Details on some basic methods is given in IM Examples, Annotationing Images,
Labeling on top of the Image itself...
http://www.imagemagick.org/Usage/annotating/#anno_on
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
pwhbeck

Re: Set darkness threshold

Post by pwhbeck »

It was suggested I post a link to my "problem":
http://www.hbeck.net

The background changes approximately every three hours during daytime, Pacific time (British Columbia).

Peter
pwhbeck

Re: Set darkness threshold

Post by pwhbeck »

How does one post a reply and indicate it is from the original submitter?

Anyway, the solution posted by fmw42:
convert image +level nnx100% result
will work for me.
Thanks to all who replied.
Peter
Post Reply