highlight blown out areas in a picture

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
rough_neck
Posts: 2
Joined: 2013-06-18T05:58:16-07:00
Authentication code: 6789

highlight blown out areas in a picture

Post by rough_neck »

Hello,

I'm writing a simple app for photographers and I want to have a feature that I see many cameras have built in.

The camera actually highlights and blinks the areas that are blown out in the photo.

I guess Blown out means over exposed, for example if you take a picture, and some areas are really bright, that would be considered blown out.

Can ImageMagick take an image and generate a new image containing the blown out regions highlighted in some way?

In my app I could take that new highlighted image and alternate it with the original one so that it would look like its blinking the high lighted area.

So the question is if imagemagick can take the original image and generate a new one with the blown out areas highlighted?

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

Re: highlight blown out areas in a picture

Post by snibgo »

Here are three methods. Windows script; adjust for other languages.

Code: Select all

rem Make test images.
%IM%convert -size 100x100 gradient: test.png
%IM%convert -size 100x100 gradient:red-blue test2.png


rem Any pixels that are exactly white are turned red.

%IM%convert test.png -fill Red -opaque White out1.png


rem Any pixels that are close to white are turned red.

%IM%convert test.png -fuzz 5%% -fill Red -opaque White out2.png


rem Any pixels that have any channel close to maximum have that channel set to zero.

%IM%convert test2.png ^
  -separate ^
  ( -clone 0 -fuzz 5%% -fill Black -opaque White ) ^
  ( -clone 1 -fuzz 5%% -fill Black -opaque White ) ^
  ( -clone 2 -fuzz 5%% -fill Black -opaque White ) ^
  -delete 0-2 ^
  -combine ^
  out3.png
You can adapt them to also highlight pixels that are zero or near zero in one or all channels.
snibgo's IM pages: im.snibgo.com
rough_neck
Posts: 2
Joined: 2013-06-18T05:58:16-07:00
Authentication code: 6789

Re: highlight blown out areas in a picture

Post by rough_neck »

Awesome, I will try it out

thanks!
rough
Post Reply