Hi all!

How can I emulate GIMP's (gimp-brightness-contrast) using ImageMagick's convert?

I have the following GIMP script, which I've wrapped in a gimp-console:

<<<<<<<<<<<<
(let*
  ((in-fn "Input.bmp")
   (out-fn "Input_out.bmp")
   (brightness -90)
   (contrast 116)
   (img (car (gimp-file-load 1 in-fn in-fn)))
   (drawable (car (gimp-image-get-active-drawable img))))
  (gimp-brightness-contrast drawable brightness contrast)
  (if (not (car (gimp-drawable-is-gray drawable)))
      (gimp-image-convert-grayscale img))
  (gimp-file-save 1 img drawable out-fn out-fn))

>>>>>>>>>>>>

The values of brightness and contrast should be settable. Reading from
the GIMP documentation:

<<<
This procedures allows the brightness and contrast of the specified
drawable to be modified.  Both 'brightness' and 'contrast' parameters
are defined between -127 and 127."
>>>

And you can find the source for it here:

http://www.koders.com/c/fid5EF9F42E3382992A0F40D7661E390A40DD16120F.aspx?s=gimp+brightness+contrast#L1

Regards and thanks in advance,

-- Shlomi Fish
-- 
------------------------------------------
Shlomi Fish http://www.shlomifish.org/

Electrical Engineering studies. In the Technion. Been there. Done
that. Forgot a lot. Remember too much.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to