Page 1 of 1

highlight blown out areas in a picture

Posted: 2013-06-18T06:11:39-07:00
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

Re: highlight blown out areas in a picture

Posted: 2013-06-18T06:51:21-07:00
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.

Re: highlight blown out areas in a picture

Posted: 2013-06-18T08:37:26-07:00
by rough_neck
Awesome, I will try it out

thanks!
rough