Image Sequence Equalize

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
burt46
Posts: 20
Joined: 2016-06-06T11:48:45-07:00
Authentication code: 1151

Image Sequence Equalize

Post by burt46 »

Hi
I have a folder with a series of images, what I would like to do is apply a histogram equalize to all images in the folder based on the properties of the first image. I looked at the

Code: Select all

–equalize
switch but I don’t know how to apply this to all images in a folder to test.

Basically all I want to do is have all images in a folder with similar brightness and contrast as I am using them in a video sequence. The images are from a timelapse camera so the variations are just in over/underexposure and I’d like to smooth them out between each image.

I would like to run this from a command line in an existing batch file.

Perhaps there is a better way of doing this. Any advice appreciated.

I did find this link, but I don’t know how to install the histmatch script.

http://superuser.com/questions/664500/n ... e-sequence

Thanks in advance
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image Sequence Equalize

Post by Bonzo »

The histmatch script is one of fmw42's and you need to specify more information - IM version, platform and programming language.
burt46
Posts: 20
Joined: 2016-06-06T11:48:45-07:00
Authentication code: 1151

Re: Image Sequence Equalize

Post by burt46 »

Thanks for the reply.

I am using Windows 10 pro and ImageMagick 7.0.2-8. I normally use .bat files for my programming and can run loops no problem.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Sequence Equalize

Post by fmw42 »

My scripts only run on Unix systems (Linux, Mac OSX or Windows with Cygwin). For Windows users, see user snibgo's web site for http://im.snibgo.com/gainbias.htm
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Sequence Equalize

Post by fmw42 »

You can also append all the images together, then run -equalize and then separate the images again. But that may take quite a bit of memory and make it impractical.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image Sequence Equalize

Post by Bonzo »

I have just remembered this: http://www.howtogeek.com/249966/how-to- ... indows-10/

You may soon be able to run the scripts without Cygwin. I can not try it as my build is way to old and for various reasons I can not update it.
burt46
Posts: 20
Joined: 2016-06-06T11:48:45-07:00
Authentication code: 1151

Re: Image Sequence Equalize

Post by burt46 »

Thanks for the tips. I like the append function but could this not be done in a similar way with mogrify through a loop?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Sequence Equalize

Post by fmw42 »

burt46 wrote:Thanks for the tips. I like the append function but could this not be done in a similar way with mogrify through a loop?
You may get different results for each image if you use -equalize separately on them. If you append, then you get the equalize on the total set of pixels from all images. The hard part will be separating them unless they are all the same size, then -crop will do the job once time.

You may have to try both ways. But I think snigo's gain/bias might be the best way to go once you pick one image or process one image the way you like it best. Then gain/bias will try to match each of the other images to the same slope and intercept (contrast and brightness).
burt46
Posts: 20
Joined: 2016-06-06T11:48:45-07:00
Authentication code: 1151

Re: Image Sequence Equalize

Post by burt46 »

Thanks for the tips, i did look at Snibgos bat files but to be honest it is far too advanced for me. I cant even see where to put in the variables to process my images.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Sequence Equalize

Post by snibgo »

Also see the recent thread viewtopic.php?f=1&t=29431 with a similar problem.
snibgo's IM pages: im.snibgo.com
Post Reply