Adjust image color levels

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
theunsheydenrych
Posts: 2
Joined: 2012-10-29T09:25:49-07:00
Authentication code: 67789

Adjust image color levels

Post by theunsheydenrych »

HI
Is it possible to adjust the color input levels of a image with imagemagick?
The process i follow with a lot of images is to open it in Gimp then adjust the input levels manually.

Regards
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Adjust image color levels

Post by fmw42 »

theunsheydenrych wrote:HI
Is it possible to adjust the color input levels of a image with imagemagick?
The process i follow with a lot of images is to open it in Gimp then adjust the input levels manually.

Regards

What do you mean by adjust the input levels? What function in GIMP? My guess is that you mean to use + or -level in IM. If you are on Linux/Mac or windows with cygwin, see my script, levels.

If this is not what you want, then please describe in more detail. Perhaps a screen snap from GIMP would help.

Also what version of IM are you using and on what platform?
theunsheydenrych
Posts: 2
Joined: 2012-10-29T09:25:49-07:00
Authentication code: 67789

Re: Adjust image color levels

Post by theunsheydenrych »

Sorry for the information not added.
Here it is.
Screenshot of Gimp Color Level adjustment before the adjustment.
http://img202.imageshack.us/img202/779/ ... evels1.png

Screenshot of Gimp Color Level adjustment after the adjustment.
http://img856.imageshack.us/img856/8168 ... evels2.png

ImageMagick Version: ImageMagick 6.6.9-7 2012-08-17 Q16
Working on Ubuntu 12.04

Is it possible to do this with ImageMagick?

Thanks for the reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Adjust image color levels

Post by fmw42 »

IM does not have any GUI, but the functionality is there with -level or with -contrast-stretch, or my script, levels, at the link below. You would have to generate a histogram to see where to set the black and white point in -level. Contrast-stretch allow you to set a clip point based upon cumulative percentage.

see
http://www.imagemagick.org/Usage/color_mods/#level
http://www.imagemagick.org/Usage/color_ ... st-stretch
http://www.imagemagick.org/Usage/color_ ... ar-stretch
http://www.imagemagick.org/script/comma ... .php#level
http://www.imagemagick.org/script/comma ... st-stretch
http://www.imagemagick.org/script/comma ... ar-stretch
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Adjust image color levels

Post by snibgo »

The technique I use is to apply the same adjustments in Gimp to a gradient file, then use IM to "clut" the image with the adjusted gradient file.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Adjust image color levels

Post by fmw42 »

snibgo wrote:The technique I use is to apply the same adjustments in Gimp to a gradient file, then use IM to "clut" the image with the adjusted gradient file.

That is a very good technique to match something from PS or GIMP with IM if you know exactly what you want to do with the image in PS.

A slightly better way is to use a HALD image and -hald-clut.

see
http://www.imagemagick.org/Usage/color_mods/#hald-clut


Note that both techniques only work on pixel-by-pixel (color changes) and will not work correctly if the modification is spatially dependent, such as convolution or blur or sharpen etc, which mix neighboring pixels.
Post Reply